Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Removing duplicates from SQL-Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2007-01-23 : 10:06:13
Bob writes "You showed how to remove rows where every column in the row is a duplicate value. What about removing rows where only certain column values are duplicated?

For example, let's say I do a SQL query on several tables, and I get the following results:

LoanID Borrower TaxID
000787 Bob 7567768
000898 Tom 9087768
000966 Jim 0987765
000787 Mary 0998767

What if I only want each loanID to appear once in the query results?

Thanks,
Bob Dickey
"

readysetstop
Posting Yak Master

123 Posts

Posted - 2007-01-23 : 14:20:22
So in this case, would you want to remove Bob, or Mary? What criteria would you use to determine which of the duplicate LoanIDs to remove?

-D.
Go to Top of Page

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2007-01-24 : 03:26:15
You have provided very limited information for us to work on..

Have a look at this Link and see if its helps

http://sqlteam.com/forums/topic.asp?TOPIC_ID=6256

Chirag

http://chirikworld.blogspot.com/
Go to Top of Page
   

- Advertisement -