SQL count(*) and distinct

前端 未结 9 2047
野趣味
野趣味 2021-02-12 11:25

Why can\'t we use count(distinct *) in SQL? As in to count all distinct rows?

9条回答
  •  面向向阳花
    2021-02-12 12:01

    You can indeed.

    If you've got an identifier, though, you won't have any entirely distinct rows. But you could do for instance:

    SELECT COUNT(DISTINCT SenderID) FROM Messages
    

提交回复
热议问题