ahmedrahil786

Price policy - Shiva Query

Aug 21st, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. select
  2. c.id as cid, c.registration_no as re_no,
  3. cc.car_name as model, z.id as zid, z.city as team, z.region as reg, z.name as zn,
  4. CASE
  5. WHEN c.default_price_policy_id between 40 and 53 THEN "HighUT"
  6. WHEN c.default_price_policy_id in (19,20,21,22,23,24,25,26,32,34) THEN "Discount"
  7. WHEN c.default_price_policy_id between 54 and 60 THEN "Special MFT"
  8. ELSE "Normal"
  9. END as price_policy
  10. from zones z, cars c, car_classes cc, price_policies pp
  11. where c.zone_id = z.id
  12. and c.car_class_id = cc.id
  13. and c.default_price_policy_id = pp.id
  14. and c.state = 'normal'
  15. and z.state = 'normal'
  16. group by cid
Advertisement
Add Comment
Please, Sign In to add comment