<HTML dir=ltr><HEAD>
<META content="text/html; charset=unicode" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.7601.18129"></HEAD>
<BODY>
<DIV><FONT color=#000000 size=2 face=Arial>I am not sure if this is a good place for this question but here goes.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>I have a table with 162 records of data including a reference ID and project_ids and a separate table with many more records with different information but also includes the reference ID.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>when I perform a </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Select a.field_one, a. field_two, b.field_one etc</FONT></DIV>
<DIV><FONT size=2 face=Arial>  from table_one a, table_two b</FONT></DIV>
<DIV><FONT size=2 face=Arial>  where a.ref_id = b.ref_id and a.project_id = b.project_id</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>or </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>
<DIV><FONT size=2 face=Arial>Select a.field_one, a. field_two, b.field_one etc</FONT></DIV>
<DIV><FONT size=2 face=Arial>  from table_one a INNER JOIN ON table_two b</FONT></DIV>
<DIV><FONT size=2 face=Arial>  where a.ref_id = b.ref_id and a.project_id = b.project_id</FONT></DIV>
<DIV> </DIV>
<DIV>I get more records back than exist in table_one</DIV>
<DIV> </DIV>
<DIV>the ref_id is in table_b multiple time but each time there is a different project_id.</DIV>
<DIV> </DIV>
<DIV>I can limit some of the repeats by putting distinct after the select but then I only get 162 records instead of the 162 records expected.</DIV>
<DIV> </DIV>
<DIV>I get the same results in pgAdmin as I do in a postGis c++ call.</DIV>
<DIV> </DIV>
<DIV>Is there a better way to write the SQL so I get exactly the same number of records as are in tabl_a</DIV>
<DIV> </DIV>
<DIV>Bruce</DIV></FONT></DIV>
<DIV>
<BR>
<BR>
This message and any enclosures are intended only for the addressee.  Please <BR>
notify the sender by email if you are not the intended recipient.  If you are <BR>
not the intended recipient, you may not use, copy, disclose, or distribute this <BR>
message or its contents or enclosures to any other person and any such actions <BR>
may be unlawful.  Ball reserves the right to monitor and review all messages <BR>
and enclosures sent to or from this email address.<BR>
</DIV></BODY></HTML>