SQL grouping by all the columns

后端 未结 9 1492
囚心锁ツ
囚心锁ツ 2020-12-29 02:04

Is there any way to group by all the columns of a table without specifying the column names? Like:

select * from table group by *
9条回答
  •  别那么骄傲
    2020-12-29 02:24

    He is trying find and display the duplicate rows in a table.

    SELECT *, COUNT(*) AS NoOfOccurrences
    FROM TableName GROUP BY *
    HAVING COUNT(*) > 1
    

    Do we have a simple way to accomplish this?

提交回复
热议问题