a guest Oct 13th, 2019 88 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- COUNT(rental_id)+COUNT(payment_id) AS discount_point,
- WHEN COUNT(rental_id)+COUNT(payment_id) < 41 THEN '10%'
- WHEN COUNT(rental_id)+COUNT(payment_id) > 59 THEN '30%'
- ELSE '20%'
- END AS discount
- FROM customer_derived
- GROUP BY customer_id, customer_name
- ORDER BY customer_id, customer_name;
RAW Paste Data