Guest User

Untitled

a guest
May 23rd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. customerID
  2. key1
  3. value1
  4.  
  5. SELECT `customer`.*, `ca1`.`value1` AS `wedding_date`, `ca2`.`value1` AS `test`
  6. FROM `customer`
  7. LEFT JOIN `customer_attributes` AS `ca1` ON customer.customerID = ca1.customerID
  8. LEFT JOIN `customer_attributes` AS `ca2` ON customer.customerID = ca2.customerID
  9. WHERE (customer.customerID = '58029')
  10. AND (ca1.key1 = 'wedding_date')
  11. AND (ca2.key1 = 'test')
  12.  
  13. SELECT `customer`.*, `ca1`.`value1` AS `wedding_date`, `ca2`.`value1` AS `test`
  14. FROM `customer`
  15. LEFT JOIN `customer_attributes` AS `ca1` ON customer.customerID = ca1.customerID AND ca1.key1='wedding_date'
  16. LEFT JOIN `customer_attributes` AS `ca2` ON customer.customerID = ca2.customerID AND ca2.key1='test'
  17. WHERE (customer.customerID = '58029')
  18.  
  19. SELECT `customer`.*, `ca1`.`value1` AS `wedding_date`, `ca2`.`value1` AS `test`
  20. FROM `customer`
  21. LEFT JOIN `customer_attributes` AS `ca1` ON customer.customerID = ca1.customerID AND ca1.key1 = 'wedding_date'
  22. LEFT JOIN `customer_attributes` AS `ca2` ON customer.customerID = ca2.customerID AND ca2.key1 = 'test'
  23. WHERE (customer.customerID = '58029')
  24.  
  25. SELECT `customer`.*, `ca1`.`value1` AS `wedding_date`, `ca2`.`value1` AS `test`
  26. FROM `customer`
  27. LEFT JOIN `customer_attributes` AS `ca1` ON customer.customerID = ca1.customerID
  28. AND (ca1.key1 = 'wedding_date')
  29. LEFT JOIN `customer_attributes` AS `ca2` ON customer.customerID = ca2.customerID
  30. AND (ca2.key1 = 'test')
  31. WHERE (customer.customerID = '58029')
Add Comment
Please, Sign In to add comment