>What would be the syntax to get the ctrl#,item from 2 like tables where customer='JONES'? My syntax returns duplicates from table 2.
>
>SELECT a.ctrl,a.item,b.ctrl,b.item FROM e:csu8 a , e:csu7 b ;
>WHERE a.cust_name = b.cust_name AND a.cust_name='JONES'
Do you have multiple items for this customer in Table2? If yes, what criteria do you want to use to get only one item?
Say,
select tbl1.Ctrl, tbl1.Item, inSql.Ctrl as CtrlB, inSQL.Item as ItemB from e:cSub8 tbl1 inner join (select top 1 Ctrl, Item from e:csu7 where Cust_Name = 'JONES' order by Ctrl ) InSQL where tbl1.Cust_Name = 'JONES'
untested.
If it's not broken, fix it until it is.
My Blog