Aleniko


Hi;

I have 2 tables. polgr.dbf and po.dbf.

I want to query all the records from polgr and some matching info from PO.
The problem is that in some cases there will be 2 records in PO with the same PO#.

The following query produces duplicates if there are 2 records matching in PO.

select polgr.qopen,po.acct from polgr left join po on polgr.pono = po.pono

Is there a join condition or other way to avoid the duplicates

Thanks.



Re: SQL Join question.

Markish


Hi Aleniko,

probably you can use subqueries....

Best regards,

Markish






Re: SQL Join question.

CetinBasoz

If po.acct is same for all pono that has the same Id then you can use distinct keyword:

select distinct polgr.qopen,po.acct from polgr left join po on polgr.pono = po.pono






Re: SQL Join question.

Naomi Nosonovsky

What is the criteria for selecting unique PO Say, you want the most recent dates info

If yes, you may want to check http://www.tek-tips.com/viewthread.cfm qid=1367284&page=1