Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### Linda Fuel penalty count
- select p.reservation_id as rid,
- date(p.impose_at + interval 8 hour) as impose_date,
- p.member_id as mid,
- p.penalty_category_id as cid
- from penalties p
- where p.penalty_category_id in ('8','9');
- ##### Linda penalties count
- select pc.name as name, count(distinct p.reservation_id) as count
- from penalties p
- left join penalty_categories pc on pc.id = p.penalty_category_id
- group by 1
- order by 2 desc
Advertisement
Add Comment
Please, Sign In to add comment