Changes between Version 7 and Version 8 of Advanced database reports (SQL and Stored procedures)


Ignore:
Timestamp:
12/28/22 16:44:33 (23 months ago)
Author:
201101
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Advanced database reports (SQL and Stored procedures)

    v7 v8  
    136136}}}
    137137
    138 == Преглед на вкупниот број резервации кои ги има направено секој од корисниците
     138== Преглед на бројот на резервации по категории за секој корисник
    139139
    140 {{{#!sql
    141 select ut.full_name , sum(gmr.reservation_id) as number_reservations
     140select ut.full_name ,
     141       (
     142                select  count(rfa.reservation_id)
     143                from reservation_for_activity rfa
     144       )as number_reservations_for_activity,
     145           (
     146                        select count(rfe.reservation_id)
     147                        from reservation_for_events rfe
     148           )as number_reservations_for_events,
     149           (
     150                        select count(rfpm.reservation_id)
     151                        from reservation_for_prepared_meal rfpm
     152           )as number_reservations_for_meal,
     153           (
     154                        select count(rfs.reservation_id)
     155                        from reservation_for_service rfs
     156           )as number_reservations_for_service
    142157from user_table ut
    143158join guests g
     
    148163on gmr.reservation_id = r.reservation_id
    149164group by 1;
    150 }}}
     165
     166
     167
    151168
    152169== Број на соби во секоја вила