Guest User

Untitled

a guest
Jul 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. SET @entityid = '100000001';
  2.  
  3. SELECT ea.attribute_code, eav.value AS 'value', 'varchar' AS 'type'
  4. FROM sales_order e
  5. JOIN sales_order_varchar eav
  6. ON e.entity_id = eav.entity_id
  7. JOIN eav_attribute ea
  8. ON eav.attribute_id = ea.attribute_id
  9. WHERE e.increment_id = @entityid
  10. UNION
  11. SELECT ea.attribute_code, eav.value AS 'value', 'int' AS 'type'
  12. FROM sales_order e
  13. JOIN sales_order_int eav
  14. ON e.entity_id = eav.entity_id
  15. JOIN eav_attribute ea
  16. ON eav.attribute_id = ea.attribute_id
  17. WHERE e.increment_id = @entityid
  18. UNION
  19. SELECT ea.attribute_code, eav.value AS 'value', 'decimal' AS 'type'
  20. FROM sales_order e
  21. JOIN sales_order_decimal eav
  22. ON e.entity_id = eav.entity_id
  23. JOIN eav_attribute ea
  24. ON eav.attribute_id = ea.attribute_id
  25. WHERE e.increment_id = @entityid
  26. UNION
  27. SELECT ea.attribute_code, eav.value AS 'value', 'datetime' AS 'type'
  28. FROM sales_order e
  29. JOIN sales_order_datetime eav
  30. ON e.entity_id = eav.entity_id
  31. JOIN eav_attribute ea
  32. ON eav.attribute_id = ea.attribute_id
  33. WHERE e.increment_id = @entityid
  34. UNION
  35. SELECT ea.attribute_code, eav.value AS 'value', 'text' AS 'type'
  36. FROM sales_order e
  37. JOIN sales_order_text eav
  38. ON e.entity_id = eav.entity_id
  39. JOIN eav_attribute ea
  40. ON eav.attribute_id = ea.attribute_id
  41. WHERE e.increment_id = @entityid
Add Comment
Please, Sign In to add comment