The query is below gives me the final result # 1. From the status column, i need to check to see if the same order is exists in table (2) then status show yes, else show no.
I am thinking about add the case after customer to check for order exits in mytbl2, but not sure about the syntax, can you help please?
select [order], customer from mytbl1 a
inner join warehouse b
on a.warehouse=b.warehouse
select [order], customer,
case when exists(select 1 from mytbl2 c where c.[order] = a.[order])
then 'Yes' else 'No' end as status
from mytbl1 a
inner join warehouse b
on a.warehouse=b.warehouse