| 112 | |
| 113 | == Одржана активност за која што има најголема заинтересираност во последната година |
| 114 | |
| 115 | |
| 116 | {{{#!sql |
| 117 | select a.activity_type as aktivnost, |
| 118 | sum(a.number_of_interested_guests) as broj_na_zainteresirani_gosti |
| 119 | from activities a |
| 120 | join reservation_for_activity rfa |
| 121 | on a.activity_id = rfa.activity_id |
| 122 | join reservation r |
| 123 | on r.reservation_id = rfa.reservation_id |
| 124 | where r.start_date between now() - interval '1 year' and now() |
| 125 | group by a.activity_type |
| 126 | order by count(a.number_of_interested_guests) desc |
| 127 | limit 1; |
| 128 | }}} |