Guest User

Untitled

a guest
Jan 23rd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. select p.*, min(price) m
  2. from oc_product p
  3. join
  4. oc_product_option_value
  5. using(product_id)
  6. group by product_id
  7. order by m
  8.  
  9. select o.*, ov.price from oc_product o
  10. join
  11. (select product_id, min(price) as price
  12. from oc_product_option_value ov
  13. group by product_id)
  14. ov on o.product_id = ov.product_id
  15. order by ov.price
Add Comment
Please, Sign In to add comment