SQL query with duplicate records

前端 未结 3 1882
走了就别回头了
走了就别回头了 2021-01-12 15:39

I am trying to write a query in SQL server to find out if there are any multiple rows for each customer by customerID. Please let me know.

Here is the table structur

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-12 16:42

    select CustomerID, count(1)
      from Customer
     group by CustomerID
    having count(1) > 1
    

提交回复
热议问题