sonixtwo Posted April 17, 2007 Posted April 17, 2007 Every product in my store should have at least 2 attributes. While I was adding a whoe load of products, I neglected to add the necessary attributes. Now, I have a few hundred products and am not sure which ones have attributes. Is there a mysql query I can run to find out which products have no attributes? Any help would be greatly appreciated. Thanks -Mike
Guest Posted April 17, 2007 Posted April 17, 2007 Every product in my store should have at least 2 attributes. While I was adding a whoe load of products, I neglected to add the necessary attributes. Now, I have a few hundred products and am not sure which ones have attributes. Is there a mysql query I can run to find out which products have no attributes? Any help would be greatly appreciated. Thanks try this : SELECT products.products_id from products where products_id not in (select products_id from products_attributes) order by products_id Corrina
sonixtwo Posted April 17, 2007 Author Posted April 17, 2007 try this :SELECT products.products_id from products where products_id not in (select products_id from products_attributes) order by products_id Corrina That is just what I was looking for. Thanks very much! -Mike
rrrhythm Posted April 18, 2007 Posted April 18, 2007 try this :SELECT products.products_id from products where products_id not in (select products_id from products_attributes) order by products_id Corrina just a heads up to folks, but this type of query, with nested selects, will only work on more recent versions of mysql, older versions will give an error. rj
Recommended Posts
Archived
This topic is now archived and is closed to further replies.