Solved

Joining SQL table with IAL table issue

  • 25 April 2023
  • 2 replies
  • 106 views

Userlevel 1
Badge +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

icon

Best answer by jolnse 25 April 2023, 11:01

View original

2 replies

Userlevel 3
Badge +8

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

 

Userlevel 1
Badge +5

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