Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET @entityid = '100000001';
- SELECT ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
- FROM sales_order e
- JOIN sales_order_varchar eav
- ON e.entity_id = eav.entity_id
- JOIN eav_attribute ea
- ON eav.attribute_id = ea.attribute_id
- WHERE e.increment_id = @entityid
- UNION
- SELECT ea.attribute_code, eav.value AS 'value', 'int' AS 'type'
- FROM sales_order e
- JOIN sales_order_int eav
- ON e.entity_id = eav.entity_id
- JOIN eav_attribute ea
- ON eav.attribute_id = ea.attribute_id
- WHERE e.increment_id = @entityid
- UNION
- SELECT ea.attribute_code, eav.value AS 'value', 'decimal' AS 'type'
- FROM sales_order e
- JOIN sales_order_decimal eav
- ON e.entity_id = eav.entity_id
- JOIN eav_attribute ea
- ON eav.attribute_id = ea.attribute_id
- WHERE e.increment_id = @entityid
- UNION
- SELECT ea.attribute_code, eav.value AS 'value', 'datetime' AS 'type'
- FROM sales_order e
- JOIN sales_order_datetime eav
- ON e.entity_id = eav.entity_id
- JOIN eav_attribute ea
- ON eav.attribute_id = ea.attribute_id
- WHERE e.increment_id = @entityid
- UNION
- SELECT ea.attribute_code, eav.value AS 'value', 'text' AS 'type'
- FROM sales_order e
- JOIN sales_order_text eav
- ON e.entity_id = eav.entity_id
- JOIN eav_attribute ea
- ON eav.attribute_id = ea.attribute_id
- WHERE e.increment_id = @entityid
Add Comment
Please, Sign In to add comment