Duplicate result

前端 未结 6 1539
走了就别回头了
走了就别回头了 2021-01-24 06:49

I am writing a query in SQL server2005. This is returning me a duplicate rows in the result. Can i eliminate this duplication with a particular column as the key?

6条回答
  •  逝去的感伤
    2021-01-24 07:12

    You can eliminate complete duplicate rows using the DISTINCT keyword. If there is some key column that is a duplicate but the rest of the columns are not, then you would have to use aggregate functions and a GROUP BY clause to explain to SQL Server what data you do want returned.

提交回复
热议问题