Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- select
- c.id as cid, c.registration_no as re_no,
- cc.car_name as model, z.id as zid, z.city as team, z.region as reg, z.name as zn,
- CASE
- WHEN c.default_price_policy_id between 40 and 53 THEN "HighUT"
- WHEN c.default_price_policy_id in (19,20,21,22,23,24,25,26,32,34) THEN "Discount"
- WHEN c.default_price_policy_id between 54 and 60 THEN "Special MFT"
- ELSE "Normal"
- END as price_policy
- from zones z, cars c, car_classes cc, price_policies pp
- where c.zone_id = z.id
- and c.car_class_id = cc.id
- and c.default_price_policy_id = pp.id
- and c.state = 'normal'
- and z.state = 'normal'
- group by cid
Advertisement
Add Comment
Please, Sign In to add comment