SQL count(*) and distinct

前端 未结 9 1975
野趣味
野趣味 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 11:50

    some languajes may not be able to handle 'distinct *' so, if you want the distinction made through many columns you might want to use 'distinct ColumnA || ColumnB' , combining the values before judging if they are different. Be mindful whether your variables are numeric and your database handler can make automatic typecast to character strings.

提交回复
热议问题