Changes between Version 7 and Version 8 of WikiStart/Analytics
- Timestamp:
- 03/30/25 21:26:19 (2 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WikiStart/Analytics
v7 v8 161 161 LIMIT 3; 162 162 }}} 163 164 == Корисници со највисок износ на депозити 165 166 {{{ 167 168 WITH deposit_totals AS ( 169 SELECT account_id, SUM(amount) AS total_deposit 170 FROM deposit 171 GROUP BY account_id 172 ) 173 174 SELECT a.id AS account_id, 175 a.username, 176 a.email, 177 COALESCE(dt.total_deposit, 0) AS total_deposit, 178 RANK() OVER (ORDER BY COALESCE(dt.total_deposit, 0) DESC) AS deposit_rank 179 FROM account a 180 LEFT JOIN deposit_totals dt ON a.id = dt.account_id 181 ORDER BY deposit_rank 182 LIMIT 3; 183 }}}