WHERE or HAVING clauses that refer back to named results could be a problem with the simple replacement.
SELECT a,b,a+b AS ab FROM t WHERE ab>10 Igor's suggestion work there too. --David Garfield Simon Slavin writes: > I'm trying to write some code which has to be useful under many different > circumstances. Something I want to be able to do is to take an arbitrary > SELECT statement and replace the columns which would normally be returned > with COUNT(*) to find out how many rows would be returned. To do this I > replace the text between "SELECT" and "FROM". > > I suspect this won't work well with unusual SELECTs which include > sub-selects. That's okay. > > I'm trying to get my head around whether JOINs could be a problem. > > Also, does anyone know whether some combination of NULs might make COUNT(*) > give the wrong result ? > > And anything else relevant anyone wants to mention is fine too. > > 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