Skip to main content

I am getting syntax error when trying to join SQL query with IAL table. Any clues??

 

 

select order_no, order_date from(

 

select *
from ifsinfo.icfr_pro_116b
where project_id = '20012') X

 

join IFSAPP.purchase_order Y

 

on

 

X.order_no = Y.order_no

 

 

Thanks

Housseiny

Try this 

select *
from ifsinfo.icfr_pro_116b  X
join IFSAPP.purchase_order Y on X.order_no = Y.order_no
where x.project_id = '20012'

 

But i do belive you need to go to the old standard for Join tables then you need to do like this 

 

select *
from ifsinfo.icfr_pro_116b  X,
      IFSAPP.purchase_order Y 
where  X.order_no = Y.order_no 
and    x.project_id = '20012'

 

 

Both should give the same result

 


Try this 

select *
from ifsinfo.icfr_pro_116b  X
join IFSAPP.purchase_order Y on X.order_no = Y.order_no
where x.project_id = '20012'

 

But i do belive you need to go to the old standard for Join tables then you need to do like this 

 

select *
from ifsinfo.icfr_pro_116b  X,
      IFSAPP.purchase_order Y 
where  X.order_no = Y.order_no 
and    x.project_id = '20012'

 

 

Both should give the same result

 

First proposed code worked like a charm. Many thanks for you rhelp


Reply