Changes between Version 22 and Version 23 of AdvancedReports
- Timestamp:
- 03/10/22 19:05:32 (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v22 v23 35 35 }}} 36 36 37 == Листа на организатори кои организирале настани на кои биле поканети 2 или повеќе артисти 38 {{{#!sql 39 select 40 u.id, 41 u.username, 42 u.email, 43 u.name, 44 o.city, 45 o.country 46 from events as e 47 join ( 48 select 49 e.id, 50 e.title, 51 count(distinct a.user_id) as num_artists 52 from events as e 53 join offers as o2 on 54 o2.event_id = e.id 55 join artists as a on 56 a.user_id = o2.artist_id 57 group by e.id 58 ) as tt on 59 tt.id = e.id and 60 tt.num_artists > 1 61 join organizers as o on 62 o.user_id = e.organizer_id 63 join users as u on 64 u.id = o.user_id 65 group by o.user_id, u.id 66 }}} 67 37 68 == Да се најде просечно време (во денови) кое било потрошено од страна на Организаторите и Артистите за да склучат договор (да платат). 38 69 … … 40 71 select avg(extract(day from o.completed_at-o.created_at)) from offers o 41 72 where completed_at notnull 73 }}} 74 75 == Број на трансакции реализирани од страна на организатори кои оставиле позитивни рецензии (оценка над 3) кон артисти 76 {{{#!sql 77 select count (*) from ( 78 with tempTable as (select 79 o.* 80 from organizers o 81 join reviews as r on 82 r.organizer_id = o.user_id and 83 r.rating > 3 84 group by o.user_id) 85 select 86 t.* 87 from events as e 88 join tempTable as tt on 89 tt.user_id = e.organizer_id 90 join offers as o2 on 91 o2.event_id = e.id 92 join transactions as t on 93 t.offer_id = o2.id 94 ) as temp 42 95 }}} 43 96