SQL count(*) and distinct

前端 未结 9 2092
野趣味
野趣味 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:03

    You can select all the columns in your table and group by...

    SELECT column1, column2, column3, count(*)
    FROM someTable
    GROUP BY column1, column2, column3
    

提交回复
热议问题