SQLite Forum

why do I get a row when querying a table with no rows?
Login
This is a misunderstanding on your part.  The group_concat() makes this an
aggregate query, and (assuming not GROUP BY or HAVING clauses) aggregate
queries always return exactly one row, regardless of the number of input rows.

To get zero rows of return if the input is empty, try this:

> ~~~
SELECT group_concat(quote(bar)) FROM t LEFT JOIN t1 HAVING count(*)>0;
~~~