| 5 | | {{{#!div style="font-size: 90%" |
| 6 | | {{{#!sql |
| 7 | | select q4."location", q4.max_broj_nastani |
| 8 | | from ( |
| 9 | | (select extract (year from t.date) as godina, count(distinct e.id_event) broj_nastani, t."location" |
| 10 | | from ticket t |
| 11 | | join events e on t.id_event =e.id_event |
| 12 | | group by godina, t."location" |
| 13 | | |
| 14 | | ) q1 |
| 15 | | |
| 16 | | join |
| 17 | | ( |
| 18 | | select max(q2.broj_nastani) as max_broj_nastani |
| 19 | | from ( |
| 20 | | select extract (year from t.date) as godina, count(distinct e.id_event) broj_nastani, t."location" |
| 21 | | from ticket t |
| 22 | | join events e on t.id_event =e.id_event |
| 23 | | group by godina, t."location" |
| 24 | | ) q2 |
| 25 | | ) q3 |
| 26 | | on q1.broj_nastani=q3.max_broj_nastani) q4 |
| 27 | | }}} |
| 28 | | }}} |
| | 108 | {{{#!div style="font-size: 90%" |
| | 109 | {{{#!sql |
| | 110 | select q4."location", q4.max_broj_nastani |
| | 111 | from ( |
| | 112 | (select extract (year from t.date) as godina, count(distinct e.id_event) broj_nastani, t."location" |
| | 113 | from ticket t |
| | 114 | join events e on t.id_event =e.id_event |
| | 115 | group by godina, t."location" |
| | 116 | |
| | 117 | ) q1 |
| | 118 | |
| | 119 | join |
| | 120 | ( |
| | 121 | select max(q2.broj_nastani) as max_broj_nastani |
| | 122 | from ( |
| | 123 | select extract (year from t.date) as godina, count(distinct e.id_event) broj_nastani, t."location" |
| | 124 | from ticket t |
| | 125 | join events e on t.id_event =e.id_event |
| | 126 | group by godina, t."location" |
| | 127 | ) q2 |
| | 128 | ) q3 |
| | 129 | on q1.broj_nastani=q3.max_broj_nastani) q4 |
| | 130 | }}} |
| | 131 | }}} |