wrong count in query

前端 未结 6 1047
故里飘歌
故里飘歌 2021-01-25 17:05

I have a table whose structure is as follows:

id  int
userid  int
status  enum (\'pending\',\'approved\')
dop     datetime

Data is as:

6条回答
  •  再見小時候
    2021-01-25 17:54

    Try to add the userid in the select clause :

    SELECT userid, count( userid )
    FROM t1
    WHERE STATUS = 'pending'
    GROUP BY userid
    

提交回复
热议问题