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

Help with query

Status
Not open for further replies.

pkailas

Programmer
Jun 10, 2002
555
US
Below is my query.

SELECT APVENADDR.[LOCATION-CODE], APVENADDR.ADDR1, APVENADDR.ADDR2, APVENADDR.[CITY-ADDR5], APVENADDR.[STATE-PROV], APVENMAST.[VENDOR-SNAME], APVENMAST.[PAY-VENDOR], PURCHORDER.[PO-CODE], PURCHORDER.[PO-NUMBER] FROM (PURCHORDER INNER JOIN APVENMAST ON PURCHORDER.VENDOR = APVENMAST.[PAY-VENDOR]) INNER JOIN APVENADDR ON APVENMAST.[PAY-VENDOR] = APVENADDR.VENDOR WHERE ((trim(PURCHORDER.[PO-NUMBER])= '748365'));

What I get back is this:
LOCATION-CODE ADDR1 ADDR2 CITY-ADDR5 STATE-PROV VENDOR-SNAME PAY-VENDOR PO-CODE PO-NUMBER
RE01 PO BOX 70000 VAN NUYS CA BECKMAN COULTER INC 6544 748365
DEPT CH 10164 PALATINE IL BECKMAN COULTER INC 6544 748365
PUR1 PO BOX 890789 DALLAS TX BECKMAN COULTER INC 6544 748365
RE01 PO BOX 70000 VAN NUYS CA COULTER CORP 6544 748365
DEPT CH 10164 PALATINE IL COULTER CORP 6544 748365
PUR1 PO BOX 890789 DALLAS TX COULTER CORP 6544 748365

I know it's a little hard to see, but what is happening is that I'm getting duplicates. I've tried DISTINCT as well as GROUP BY but I still get the 6 rows when I only want the unique records listed once.

Can someone see what's wrong with my query?

Thanks,

Paul



_______
I love small animals, especially with a good brown gravy....
 
duh!

I see that the VENDOR-SNAME isn't unique.. I'm a moron!

_______
I love small animals, especially with a good brown gravy....
 
I don't see any duplicates ???

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top