From 9c6ad5f2e6731d53283b13d604b483a9c78c506a Mon Sep 17 00:00:00 2001 From: mauirixxx Date: Tue, 14 Aug 2018 16:37:59 -1000 Subject: [PATCH] Update page 'Useful SQL commands' --- Useful-SQL-commands.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Useful-SQL-commands.md b/Useful-SQL-commands.md index f3d8b93..fb550d8 100644 --- a/Useful-SQL-commands.md +++ b/Useful-SQL-commands.md @@ -17,4 +17,8 @@ Select account wide stats, with next rank in line: * SELECT * FROM gwaccstats JOIN gwsubtitles ON gwaccstats.stnameid = gwsubtitles.titlenameid WHERE titlepoints < stpoints LIMIT 1; Better select of account wide stats? -* SELECT * FROM gwaccstats JOIN gwsubtitles ON gwaccstats.titlenameid = gwsubtitles.titlenameid WHERE titlepoints > stpoints AND gwaccstats.titlenameid = 1; \ No newline at end of file +* SELECT * FROM gwaccstats JOIN gwsubtitles ON gwaccstats.titlenameid = gwsubtitles.titlenameid WHERE titlepoints > stpoints AND gwaccstats.titlenameid = 1; + +Get maxed out account titles first, sorted by rank, THEN by percentage over max rank: +* SELECT * FROM gwaccstats WHERE userid = ? AND accid = ? AND percent > 100 ORDER BY currentstrank DESC, percent DESC; +* to get the unmaxed account titles sorted, just flip the > to < \ No newline at end of file