Thanks Simon

I suspected as much - UNION is no good for me, it's easy enough to
iterrate through in C. But not really what I was after.
Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
http://sandersonforensics.com/forum/content.php?168-Reconnoitre - VSC
processing made easy



On 17 November 2014 11:38, Simon Slavin <slav...@bigfraud.org> wrote:
>
> On 17 Nov 2014, at 10:55am, Paul Sanderson <sandersonforens...@gmail.com> 
> wrote:
>
>> Is it possible to get a row count for each of the tables in a database
>> using a SQL query.
>>
>> i.e.
>>
>> is there a way I could use each row in sqlite_master and use
>> table_name to somehow do a select count(*) from
>> sqlite.master.table_name
>
> No, but you can use UNION to get something like it:
>
> SELECT 'table1',count(*) FROM table1
> UNION
> SELECT 'table2',count(*) FROM table2
>
> should do something like what you want.  As far as I know, there's no way 
> within SQL to use a table name as a variable.  I suspect that this was done 
> deliberately to enforce correct schema.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to