I have a table whose structure is as follows:
id int userid int status enum (\'pending\',\'approved\') dop datetime
Data is as:
Try to add the userid in the select clause :
SELECT userid, count( userid ) FROM t1 WHERE STATUS = 'pending' GROUP BY userid