Changes between Version 11 and Version 12 of AdvancedDatabaseReports


Ignore:
Timestamp:
12/21/22 16:51:47 (2 years ago)
Author:
181085
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AdvancedDatabaseReports

    v11 v12  
    1414{{{#!sql:
    1515SELECT 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_km
     16SUM(pay.total_sum_payed) as total_price_paid, SUM(pay.total_sum_payed)/SUM(d.km_travelled) as price_per_km
    1717FROM request r
    1818JOIN drive d ON r.request_id = d.request_id
    1919JOIN 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'
     20WHERE r.passenger_id = '87da7c89-fc2e-44a0-9bfa-d89de68c2a22'
    2221GROUP BY d.driver_id
    23 ORDER BY price_per_km ASC 
     22ORDER BY price_per_km ASC
    2423}}}
    2524
     
    5150JOIN drive d ON r.request_id = d.request_id
    5251JOIN payment pay ON d.drive_id = pay.drive_id
    53 WHERE d.driver_id = '2219f3ad-48dc-4b6a-9877-143b05d6b608'
     52WHERE d.driver_id = '7c183cbe-bfb3-4e16-b831-e4f73c4f4937'
    5453GROUP BY p.passenger_id , p.email
    5554ORDER BY earnings_per_km DESC