You know we can easily fetch the product names using the Model object.
But what if you want to list out all the product names via SQL code?
Don’t worry here is the SQL code for you:
SELECT `value` AS product_name
FROM catalog_product_entity_varchar
WHERE entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product')
AND attribute_id = (SELECT attribute_id FROM eav_attribute WHERE attribute_code = 'name' AND entity_type_id = (SELECT entity_type_id FROM eav_entity_type WHERE entity_type_code = 'catalog_product'))
Cheers!!
thanks ! first step is good than nothing.. im planning to use raw sql and skip these EAV in magento
you just saved my day 🙂 thanks
very bad inner queries. not good for performance
This query giving error Unknown column ‘entity_type_id’ in ‘where clause’ for me i am working on magento 2.1