On 3/23/07, Noah Hart <[EMAIL PROTECTED]> wrote:
Using only SQLite and SQL, is there a way to get a count of rows in each
table in the database?

I know I can do this via an external application to query sqlite_master
and using that list, query a row count of each table, but would prefer
to find a pure SQL way if possible.

I believe what you want is something like a single select that takes
the table name for the count on another sub-select to the
sqlite_master table, but as far as I know (I also wanted something
similar one time) that can't be done, because under SQL a table name
isn't an expression, so can't be replaced with a sub-select.

In other words: "SELECT count(*) FROM ?" is not valid (gives diferent
compiled SQL for each table name), so you can't replace "?" for a
sub-select.


Regards,
~Nuno Lucas


Thanks,

Noah

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to