The Little Guy Posted November 3, 2008 Share Posted November 3, 2008 I have 1 column "eType", it contains either the value 'ns' or 'sa', how do I find the count of both of these, and place them in one row instead of 2 rows, and give them a custom column name, such as 'ns' and 'sa'? Quote Link to comment https://forums.phpfreaks.com/topic/131212-count/ Share on other sites More sharing options...
Mchl Posted November 3, 2008 Share Posted November 3, 2008 One way to do it. SELECT (SELECT COUNT(*) FROM table WHERE eType = 'ns') AS ns, (SELECT COUNT(*) FROM table WHERE eType = 'sa') AS sa Quote Link to comment https://forums.phpfreaks.com/topic/131212-count/#findComment-681249 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.