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'? 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 Link to comment https://forums.phpfreaks.com/topic/131212-count/#findComment-681249 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.