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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query that returns no duplicates

Status
Not open for further replies.

haytatreides

IS-IT--Management
Oct 14, 2003
94
US
Hi all, I have a table structed like this

fld1 fld2 fld3 fld4
1234 bbbb cccc 1111
1235 bbbb cccc 1111
1236 bbbb dddd 2222
1237 eeee dddd 2222
1238 eeee dddd 2222

what i want to do is list in the query, data that is not a duplicate of fields 2,3, and 4. so if those three fields are duplicated in combination, then list them once, like 1237 and 1238, list only 1237. does anyone have any idea how to do this??? i have searched the posts, but found nothing too close to what i need. I am guessing there is a way to use distinct, but i have no idea how. Please help me, and I will give you my first born.
 
select min(fld1),fld2,fld3,fld4
from table1
group by fld2,fld3,fld4


Mike Pastore

Hats off to (Roy) Harper
 
thanks, i actually just concatenated them and assigned an alias then did a distinct.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top