Changes between Version 9 and Version 10 of izvestai


Ignore:
Timestamp:
01/29/25 21:00:19 (27 hours ago)
Author:
213209
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • izvestai

    v9 v10  
    4646    ROUND(AVG(rh.party_size), 1) AS average_party_size,
    4747    MAX(rh.party_size) AS max_party_size,
    48     COUNT(*) AS number_of_reservations
     48    COUNT(rh.id) AS number_of_reservations
    4949FROM reservation_history rh
    5050JOIN "tables" t ON t.tableid = rh.table_id 
     
    5555}}}
    5656
     57== Извештај за најрезервиран временски период во ресторан
     58{{{
     59SELECT
     60    r."name",
     61    CONCAT(
     62        LPAD(DATE_PART('hour', rh.check_in_date)::TEXT, 2, '0'),
     63        ':00 - ',
     64        LPAD((DATE_PART('hour', rh.check_in_date) + 2)::TEXT, 2, '0'),
     65        ':00'
     66    ) AS hour_slot,
     67    COUNT(rh.id) AS totalReservations
     68FROM reservation_history rh
     69JOIN restaurants r ON rh.restaurant_id = r.restaurantid
     70GROUP BY hour_slot, r."name"
     71ORDER BY totalReservations DESC, r."name" 
     72LIMIT 5;
     73}}}