wrong count in query

前端 未结 6 1045
故里飘歌
故里飘歌 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 18:06

    Do you want to count the number of user with status pending then?

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

提交回复
热议问题