Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove duplicate field data

Status
Not open for further replies.

nuVBer

Programmer
Jul 6, 2001
63
US
I have a view that has data similar to this:

ID comp_sk comp_name
980 100792 sl14907
981.01 101539 s1595
981.01 150617 s1595
988 100870 s24442

I want to return only the first, third and last rows. I want to eliminate the duplicate 981.01 ID...I just want the larger of the comp_sk value for each duplicate ID value. How can this be done?
 
Select ID, max(comp_sk), comp_name
From Table1
Group by ID, comp_name
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top