0

I wanna show in my mysql query of all attributes name,product name, product status is 1 and sku but in my query its not showing product name and status so could you help me in my this query ?

 SELECT  ce.entity_id ,s.attribute_set_name,sk.sku,a.attribute_id FROM catalog_product_entity_int ce
LEFT JOIN catalog_product_entity sk ON sk.entity_id = ce.entity_id
LEFT JOIN eav_attribute_set s ON sK.attribute_set_id = s.attribute_set_id
LEFT JOIN eav_attribute a ON a.attribute_id = ce.attribute_id WHERE a.attribute_code LIKE 'status' AND ce.value = 1

it showing below result enter image description here

1 Answer 1

0

Change you SQL query as below

SELECT  ce.entity_id , s.attribute_set_name, sk.sku, skv.value as 
product_name, a.attribute_id FROM catalog_product_entity_int ce
LEFT JOIN catalog_product_entity sk ON sk.entity_id = ce.entity_id
LEFT JOIN catalog_product_entity_varchar skv ON sk.entity_id = skv.entity_id
LEFT JOIN eav_attribute_set s ON sk.attribute_set_id = s.attribute_set_id
LEFT JOIN eav_attribute a ON a.attribute_id = ce.attribute_id WHERE a.attribute_code LIKE 'status' AND ce.value = 1

enter image description here

3
  • thanks but in product_name column its showing product name and as well as its other attribute value like option value , product url key.. in product_name column it should be only product name only Aug 17, 2020 at 13:11
  • in the first line "SELECT ce.entity_id , s.attribute_set_name, sk.sku, skv.value as product_name" here you can change 'product_name' to whatever you want. Aug 17, 2020 at 13:22
  • I am not talking about product_name column text sir I am getting the other attribute value in product name column so I want only product name attribute value in product name textbox Aug 17, 2020 at 13:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.