SQL Math
Tuesday, May 5th, 2009In 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
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