By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,363 Members | 2,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,363 IT Pros & Developers. It's quick & easy.

Re: T-SQL Duplicate Record Help

P: n/a
Here is one way to return all duplicate rows based on the two columns (SQL
Server 2005):

;WITH Dups
AS
(SELECT reference_, suppliercode_, value_,
COUNT(*) OVER(
PARTITION BY reference_,
value_) AS cnt
FROM #TMP)
SELECT reference_, suppliercode_, value_
FROM Dups
WHERE cnt 1;
HTH,

Plamen Ratchev
http://www.SQLStudio.com

Jun 27 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.