I am able to get the value of a custom attribute from the following query, however, the number doesn't help much. I would like to get the actual name of the value.
SELECT entity.sku, entity.type_id as 'type', entity_cod_custom_attribute.value as 'cod_custom_attribute'
FROM catalog_product_entity entity
LEFT JOIN catalog_product_entity_int entity_cod_custom_attribute ON entity_cod_custom_attribute.entity_id = entity.entity_id AND entity_cod_custom_attribute.attribute_id = (SELECT attribute_id FROM eav_attribute ea LEFT JOIN eav_entity_type et ON ea.entity_type_id = et.entity_type_id WHERE ea.attribute_code = 'cod_custom_attribute' AND et.entity_type_code = 'catalog_product')
This gives me: SKU-ABC, simple, 355
where 355 is actually "Adult-Large"
I would like it to show: SKU-ABC, simple, Adult-Large
It looks like I need to do a bit more connecting from the eav_attribute_option table and the eav_attribute_option_value tables.
Any suggestions?