rseigel Posted July 30, 2015 Share Posted July 30, 2015 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 Link to comment https://forums.phpfreaks.com/topic/297560-another-select-issue/ Share on other sites More sharing options...
mikosiko Posted July 30, 2015 Share Posted July 30, 2015 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 Link to comment https://forums.phpfreaks.com/topic/297560-another-select-issue/#findComment-1517774 Share on other sites More sharing options...
rseigel Posted July 30, 2015 Author Share Posted July 30, 2015 LOL.....I got it backwards (I need the other one too) SELECT * FROM tmp_BF WHERE supplier_reference NOT IN ( SELECT product_supplier_reference FROM ps_product_supplier Link to comment https://forums.phpfreaks.com/topic/297560-another-select-issue/#findComment-1517776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.