Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.28 KB | None | 0 0
  1. SELECT * from product
  2. ORDER BY
  3.     CASE
  4.         WHEN NOT ISNULL(promotion_price) and is_active = 1 THEN 1
  5.         WHEN ISNULL(promotion_price) and is_active = 1 THEN 2
  6.         WHEN ISNULL(promotion_price) and is_active = 0 THEN 3
  7.         WHEN NOT ISNULL(promotion_price) and is_active = 0 THEN 4
  8.     END ASC
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement