2011/6/29 Roger Andersson <r...@telia.com>

> SELECT round(cast(COUNT(rowid)*100 as real)/(SELECT COUNT(*) FROM
> people),2) FROM people WHERE zip="12345";
>

Would it not be better to do the CAST on the second SELECT? Then there is
only one CAST needed. In this case it does not matter much, but in the
general case it could.
Or maybe even better instead of doing * 100 in the first select, do * .01 in
the second.

-- 
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to