We have a table that records stores that are valid to receive a product.
If a product exists and the store exists then the store is valid to
receive that product. If there is no product in the table then the store
is still valid to receive the product. If the product exists and the
store does not then obviously the store cannot receive the product.
I can tell if the store is valid to receive the product if there is a
store record; however I am having trouble telling the difference between
the store not being valid because there is no product code or not being
valid because it does receive a product code. In testing the last two
cases I always get a NULL result set.
For the sample data provided assume there is another table controlling
the product numbers and there are no gaps. So for #1 (not in sample
data set) store 1 would be valid to receive, but for #8 or 11 store 1
would not be valid to receive product.
Thanks, Matt
Below is the link to SQL code to create table in question with sample
data for table.
http://code.midrange.com/8c8ef57c0f.html
As an Amazon Associate we earn from qualifying purchases.