GFDB-ガルフレランキングデータベース-

TOP

SQL実行フォーム 登録SQL一覧 設定変更

SQL文

WITH users_crown AS ( SELECT cr.userId , SUM(cr.crownCount) AS cnt FROM crownRanking cr WHERE cr.userId > 0 GROUP BY cr.userId HAVING cnt > 0 ORDER BY cnt DESC LIMIT 1000 OFFSET :offset ) SELECT x.cnt AS "王冠累計獲得数" , (SELECT ROUND(AVG(r.rank), 1) FROM ranking r LEFT JOIN events e ON e.eventId = r.event WHERE r.userId = x.userId AND e.termEnd >= 20140819 AND e.eventId NOT LIKE "%.5" ) AS "平均順位" , u.userId AS "ユーザーID" , u.userName AS "ユーザー名" , u.level AS "レベル" , u.clubId AS "部活ID" , c.clubName AS "部活名" FROM users_crown x LEFT JOIN users u ON x.userId = u.userId LEFT JOIN clubs c ON u.clubId = c.clubId ORDER BY x.cnt DESC

コメント

王冠累計獲得数ランキング

SQL結果 0.42108 秒

result
17001 一致する結果がありません