Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Eliminate records duplication other than using DISTINCT and GROUP BY

Status
Not open for further replies.

Guest
Hi,
I have a table like this

Cus_no Add_type Addr1 Addr2 Addr3 Zipcode

with primary keys being Cus_no and Add_type. There are thousand of customer records. And there are more than one record (address) for each customer. Now, I intend to extract only one record (address) per customer whichever come first using SQL. I have tried using SELECT statement with DISTINCT and GROUP BY but both doesn't eliminate the records duplication. Somebody please advice me. Thanks in advance.
 
Replies continue below

Recommended for you

hi,

I am not able to understand the question. Please send me the details. I need the table structure and constraints information. my mail id is biosraman@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor