Archive for May, 2009

SQL Math

Tuesday, May 5th, 2009

In my quest to avoid looping in code when I can figure out how to use a query:

select cast((select count(*) from tblA where foo is not null) as float) /
(select count(*) from tblA) * 100