SQL_Kills (9/8/2013)
Hi,I don't want to alter any table, I want this done by a sql select statement only? Plus this would not work as only want it to appear as Yes where every product is matched on the order line?
Thanks
Ok, then the following query will probably help you:
select p.*, s.*,
case
when s.ProductID = p.ProductID then 'Yes'
else 'No'
end as OrderMatch
From salesOrders s left join ProductList p
on s.ProductID = p.ProductID
Regards
IgorMi
Igor Micev,My blog: www.igormicev.com