Is it possible to count two columns in the same query

后端 未结 4 1020
栀梦
栀梦 2020-12-05 18:58

Let\'s say I have the following table structure:

t1
-------------
id // row id
userID_follower // this user is a follows another member
userID_following  //          


        
4条回答
  •  抹茶落季
    2020-12-05 19:48

    I think something like this should work:

    select ownerID, count( distinct userID_follow), count(distinct userID_following) from t1 group by ownerID
    

提交回复
热议问题