Skip to main content
Solved

Joining SQL table with IAL table issue

  • April 25, 2023
  • 2 replies
  • 168 views

Forum|alt.badge.img+5

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

Best answer by jolnse

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

 

2 replies

Forum|alt.badge.img+8
  • Sidekick (Partner)
  • Answer
  • April 25, 2023

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

 


Forum|alt.badge.img+5
  • Author
  • Sidekick (Customer)
  • April 25, 2023

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