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
Was it helpful?

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;
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top