Nothing wrong, but is it the fastest? RBS
-----Original Message----- From: Scott Hess [mailto:[EMAIL PROTECTED] Sent: 13 December 2006 17:25 To: sqlite-users@sqlite.org Subject: Re: [sqlite] Check for empty table On 12/13/06, RB Smissaert <[EMAIL PROTECTED]> wrote: > Trying to find the fastest way to determine if a table has no rows. > > I think this will do: > SELECT (SELECT ROWID FROM table limit 1) IS NOT NULL; > If a table has rows then the result should be 1. What's wrong with "SELECT COUNT(*) FROM table;"? -scott ---------------------------------------------------------------------------- - To unsubscribe, send email to [EMAIL PROTECTED] ---------------------------------------------------------------------------- - ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------