Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How can I find which products do not have attributes?


sonixtwo

Recommended Posts

Posted

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

Posted
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

Posted
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

Posted
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...