On Wed, 17 May 2006, Malk0 wrote:

[...]
BUT if i add a GROUP BY clause in the subselect the results returned
in ct is just false ex:
- doing
SELECT count(*) FROM (SELECT * FROM mytable GROUP BY col1) _TMPTABLE_;
return one row with 20 in ct and that's FALSE, this is the total
amount of row in mytable instead of the amount of grouped row

Am i doing something wrong? tested on a mysql database give me correct
results, is this a bug, is there any way to work around?
[...]

Hello,

I tested this with SQLite 3.3.5 and it works just fine.

But to circumvent the problem you could apply some aggregate function to your data in the sub select, e.g.
  SELECT count(*) FROM (SELECT count(*) FROM table GROUP BY column);

Looks strange, but works on SQLite 2.8.13, the only old SQLite2 installation I still had lying around on an old box by chance.

cu,
Thomas

Reply via email to