http://qs1969.pair.com?node_id=11135505


in reply to SQLite: how to get a number of rows from SELECT query

If the SQLite is new enough, you could use a window function:

select * , count(*) over () as rowcount from t ;

(But of course, now you have an extra column which is not always what you want. YMMV, etc)