Jump to content
Sign in to follow this  
rseigel

Another SELECT issue

Recommended Posts

I have two tables that I'm trying to compare. I need to find items that are in tmp_BF and not in ps_product_supplier.
 
I'm using:
 

SELECT * FROM ps_product_supplier WHERE ps_product_supplier.product_supplier_reference NOT IN (SELECT supplier_reference FROM tmp_BF);

The column names are correct. The table names are correct. It returns zero rows even though I know for a fact that it shouldn't.
 
This must be something simple.
 
Any thoughts?
 
Thanks,
 
Ron

Share this post


Link to post
Share on other sites

I have two tables that I'm trying to compare. I need to find items that are in tmp_BF and not in ps_product_supplier.

 

I'm using:

 

SELECT * FROM ps_product_supplier WHERE ps_product_supplier.product_supplier_reference NOT IN (SELECT supplier_reference FROM tmp_BF);

 

Read carefully what you wrote (in red) and compare it with what you are doing in your select... you should be able to figure it out

Share this post


Link to post
Share on other sites

LOL.....I got it backwards (I need the other one too)  :wacko:

SELECT * 
FROM tmp_BF
WHERE supplier_reference NOT 
IN (

SELECT product_supplier_reference
FROM ps_product_supplier

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.