ahmedrahil786

Penalty info - Rahil for Linda

Apr 2nd, 2020
1,071
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1.  
  2. ##### Linda Fuel penalty count
  3. select p.reservation_id as rid,
  4. date(p.impose_at + interval 8 hour) as impose_date,
  5. p.member_id as mid,
  6. p.penalty_category_id as cid
  7. from penalties p
  8. where p.penalty_category_id in ('8','9');
  9.  
  10.  
  11.  
  12.  
  13. ##### Linda penalties count
  14. select pc.name as name, count(distinct p.reservation_id) as count
  15. from penalties p
  16. left join penalty_categories pc on pc.id = p.penalty_category_id
  17. group by 1
  18. order by 2 desc
Advertisement
Add Comment
Please, Sign In to add comment