many_tentacles
02-25-2010, 03:04 PM
I have the following query...
SELECT (SELECT COUNT(*) FROM my_table WHERE col1 = 'Y') AS Total1, (SELECT COUNT(*) FROM my_table WHERE col2 = 'Y') AS Total2, (SELECT COUNT(*) FROM my_table WHERE col3 = 'Y') AS Total3, (SELECT COU... etc etc
This will carry on until I get to col150. Do i really need to repeat the query that many times to create a results table?
thanks
SELECT (SELECT COUNT(*) FROM my_table WHERE col1 = 'Y') AS Total1, (SELECT COUNT(*) FROM my_table WHERE col2 = 'Y') AS Total2, (SELECT COUNT(*) FROM my_table WHERE col3 = 'Y') AS Total3, (SELECT COU... etc etc
This will carry on until I get to col150. Do i really need to repeat the query that many times to create a results table?
thanks