Changes between Version 11 and Version 12 of AdvancedDatabaseReports
- Timestamp:
- 12/21/22 16:51:47 (2 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedDatabaseReports
v11 v12 14 14 {{{#!sql: 15 15 SELECT d.driver_id, SUM(d.km_travelled) as km_travelled_with_driver, 16 SUM(pay.total_sum_payed) as total_price_paid, SUM( d.km_travelled)/SUM(pay.total_sum_payed) as price_per_km16 SUM(pay.total_sum_payed) as total_price_paid, SUM(pay.total_sum_payed)/SUM(d.km_travelled) as price_per_km 17 17 FROM request r 18 18 JOIN drive d ON r.request_id = d.request_id 19 19 JOIN payment pay ON pay.passenger_id = r.passenger_id 20 WHERE r.passenger_id = '77d9c766-e0c1-4e53-86d0-bafc3101a1ac' AND 21 d.start_time between now() and now() - interval '2 months' 20 WHERE r.passenger_id = '87da7c89-fc2e-44a0-9bfa-d89de68c2a22' 22 21 GROUP BY d.driver_id 23 ORDER BY price_per_km ASC 22 ORDER BY price_per_km ASC 24 23 }}} 25 24 … … 51 50 JOIN drive d ON r.request_id = d.request_id 52 51 JOIN payment pay ON d.drive_id = pay.drive_id 53 WHERE d.driver_id = ' 2219f3ad-48dc-4b6a-9877-143b05d6b608'52 WHERE d.driver_id = '7c183cbe-bfb3-4e16-b831-e4f73c4f4937' 54 53 GROUP BY p.passenger_id , p.email 55 54 ORDER BY earnings_per_km DESC