Changes between Version 13 and Version 14 of AdvancedReports
- Timestamp:
- 08/05/26 11:02:56 (21 hours ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
AdvancedReports
v13 v14 215 215 COALESCE(COUNT(l.timestamp),0) AS listen_count 216 216 FROM artists a 217 JOIN performs_at pa ON pa.artist_id=a.user_id218 JOIN musical_entities me ON me.released_by=pa.artist_id217 LEFT JOIN contributions c ON c.artist_id = a.user_id 218 LEFT JOIN songs s ON s.id = c.musical_entity_id 219 219 LEFT JOIN listens l ON l.song_id=me.id 220 220 GROUP BY a.user_id … … 228 228 FROM events e 229 229 JOIN performs_at pa ON pa.event_id=e.event_id 230 JOIN followersCount fc ON fc.user_id =pa.artist_id230 JOIN followersCount fc ON fc.user_id = pa.artist_id AND fc.event_id = e.event_id 231 231 JOIN listensCount lc ON lc.user_id=fc.user_id 232 232 JOIN users u ON u.user_id=lc.user_id … … 262 262 ( 263 263 ( 264 (artists a ⨝ (a.user_id = pa.artist_id) performs_at pa)265 ⨝ (pa.artist_id = me.released_by) musical_entities me264 (artists a ⟕ (a.user_id = c.artist_id) contributions c) 265 ⟕ (pa.artist_id = me.released_by) songs s 266 266 ) 267 267 ⟕ (me.id = l.song_id) listens l … … 276 276 ⨝ (e.event_id = pa.event_id) performs_at pa 277 277 ) 278 ⨝ (pa.artist_id = fc.user_id ) FollowersCount fc279 ) 280 ⨝ ListensCount lc281 ) 282 ⨝ users u278 ⨝ (pa.artist_id = fc.user_id ∧ e.event_id = fc.event_id) FollowersCount fc 279 ) 280 ⨝ (fc.user_id = lc.user_id) ListensCount lc 281 ) 282 ⨝ (lc.user_id = u.user_id) users u 283 283 ) 284 284 … … 328 328 SELECT 329 329 EXTRACT(MONTH FROM l.timestamp) AS month, 330 a.user_id,COUNT(l.timestamp)AS count 330 a.user_id, 331 COUNT(l.timestamp)AS count 331 332 FROM listens l 332 333 JOIN one_year oy ON l.timestamp>=oy.year_start AND l.timestamp<=oy.year_end 333 JOIN musical_entities me ON l.song_id=me.id334 JOIN artists a ON a.user_id= me.released_by334 JOIN contributions c ON c.musical_entity_id = l.song_id 335 JOIN artists a ON a.user_id=c.artist_id 335 336 GROUP BY EXTRACT(MONTH FROM l.timestamp),a.user_id 336 337 ), … … 391 392 ⨝ (l.timestamp ≥ oy.year_start ∧ l.timestamp ≤ oy.year_end) OneYear oy 392 393 ) 393 ⨝ (l.song_id = me.id) musical_entities me394 ) 395 ⨝ ( me.released_by= a.user_id) artists a394 ⨝ (l.song_id = c.musical_entity_id) contributions c 395 ) 396 ⨝ (c.artist_id = a.user_id) artists a 396 397 ) 397 398 … … 462 463 FROM listens l 463 464 JOIN one_month om ON l.timestamp between om.prev_period_start AND om.prev_period_end 464 JOIN musical_entities me ON l.song_id = me.id465 RIGHT JOIN artists a ON a.user_id = me.released_by465 JOIN contributions c ON c.musical_entity_id = l.song_id 466 RIGHT JOIN artists a ON a.user_id = c.artist_id 466 467 GROUP BY a.user_id 467 468 HAVING count(l.timestamp) > 0 … … 473 474 FROM listens l 474 475 JOIN one_month om ON l.timestamp between om.this_period_start AND om.this_period_end 475 JOIN musical_entities me ON l.song_id = me.id476 RIGHT JOIN artists a ON a.user_id = me.released_by476 JOIN contributions c ON c.musical_entity_id = l.song_id 477 RIGHT JOIN artists a ON a.user_id = c.artist_id 477 478 GROUP BY a.user_id 478 479 ), … … 524 525 OneMonth om 525 526 ) 526 ⨝ (l.song_id = me.id) musical_entities me527 ) 528 ⟖ ( me.released_by= a.user_id) artists a527 ⨝ (l.song_id = c.musical_entity_id) contributions c 528 ) 529 ⟖ (c.artist_id = a.user_id) artists a 529 530 ) 530 531 ) … … 540 541 OneMonth om 541 542 ) 542 ⨝ (l.song_id = me.id) musical_entities me543 ) 544 ⟖ ( me.released_by= a.user_id) artists a543 ⨝ (l.song_id = c.musical_entity_id) contributions c 544 ) 545 ⟖ (c.artist_id = a.user_id) artists a 545 546 ) 546 547
