Question

I want to get disabled products id's and products price in magento 2 by using SQL Query ?

By using this i'm getting disabled product but how to get price for that products.

SELECT entity_id FROM `catalog_product_entity_int`
WHERE attribute_id = (
SELECT attribute_id FROM `eav_attribute`
WHERE `attribute_code` LIKE 'status'
) AND `catalog_product_entity_int`.value = 2
Était-ce utile?

La solution

Try this:

SELECT entity_id, value as price from catalog_product_entity_decimal
WHERE entity_id IN (SELECT entity_id FROM `catalog_product_entity_int`
WHERE attribute_id = (
SELECT attribute_id FROM `eav_attribute`
WHERE `attribute_code` LIKE 'status'
) AND `catalog_product_entity_int`.value = 2) AND attribute_id = 77;
Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top