dsoms on 04/09/11
Last Edited at 04/09/11 01:29am
SELECT id, sum(if (`user_type` = 1, 1, 0)) as COUNT_TYPE1, sum(if (`user_type` = 2, 1, 0)) as COUNT_TYPE2, sum(if (`user_type` = 3, 1, 0)) as COUNT_TYPE3, sum(if (`user_type` = 4, 1, 0)) as COUNT_TYPE4FROM usersGROUP BY id
Report this snippet Tweet
Comment:
You need to login to post a comment.