Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
skriver
Starting Member
11 Posts |
Posted - 2012-05-28 : 04:53:04
|
| HiWe have a main product table and also another table that shows those products mapped to a supplier. I am trying to find a way of showing those products not mapped to a supplier.If I run this command I get a list of the Product ID's but I am trying to get a list of the names. So if I run this it works fineselect ProductID from dbo.Product where ProductID not in (select distinct ProductID from dbo.ProductCategory)Then if I run this I get an empty list. Any ideas where I am going wrong?select SKU from dbo.Product where SKU not in (select distinct SKU from dbo.ProductCategory) |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-28 : 13:20:59
|
i think what you need is this based on your table relationship?select SKU from dbo.Product where ProductID not in (select distinct ProductID from dbo.ProductCategory) ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|