Changes between Version 4 and Version 5 of AdvancedReports
- Timestamp:
- 12/23/22 11:57:49 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v4 v5 53 53 54 54 {{{#!sql 55 select a.user_id,b.username, a.prihod 55 select a.user_id, 56 b.username, 57 a.prihod 56 58 from ( 57 select user_id,58 sum(v.daily_rental_price * (c.end_date - c.start_date)) as prihod59 from contracts c60 join vehicles v on v.vehicle_id = c.vehicle_id61 group by c.user_id ) a62 join (63 select c.user_id, u.username from clients as c64 join users u on u.user_id = c.user_id65 ) b on a.user_id = b.user_id59 select user_id, 60 sum(v.daily_rental_price * (c.end_date - c.start_date)) as prihod 61 from contracts c 62 join vehicles v on v.vehicle_id = c.vehicle_id 63 group by c.user_id ) a 64 join ( 65 select c.user_id, u.username from clients as c 66 join users u on u.user_id = c.user_id 67 ) b on a.user_id = b.user_id 66 68 where a.prihod = 67 (select max(prihod) from (select user_id,sum(v2.daily_rental_price * (c4.end_date - c4.start_date)) as prihod from contracts c4 68 join vehicles v2 on v2.vehicle_id = c4.vehicle_id group by user_id) maximprihod) 69 (select max(prihod) from ( 70 select user_id,sum(v2.daily_rental_price * (c4.end_date - c4.start_date)) as prihod 71 from contracts c4 72 join vehicles v2 on v2.vehicle_id = c4.vehicle_id 73 group by user_id) maximprihod 74 ) 69 75 }}} 70 76