View Single Post
pan0s
Senior Member
Join Date: Nov 2017
Old 10-27-2022 , 13:14   Re: [L4D2] Statistic and Ranking System (SRS) [v2.5 | 17 March 2022]
Reply With Quote #52

Quote:
Originally Posted by kochifish View Post
Ok this one is fixed, i change the database ddriver to another, then i update the SQL query in plugin source, because sqlite and mysql have some difference, but now i only have one problem with this one query:


PHP Code:
case DBA_LOAD:
            {
                
Format(querysizeof(query), "SELECT * FROM (SELECT RANK() OVER (ORDER BY t.Score DESC, t.CreatedDate DESC) AS `globalRank` FROM (SELECT * from l4d2_srs.srs GROUP BY steamId) AS t) AS `rt` WHERE rt.globalRank = '%s'"steamId);
                
g_db.Query(OnSelectRowqueryclient);
            } 
Could you please help me to convert that query syntax to mysql 8 syntax? i tried but no success, im not an expert with sql. Thank you!
I don't set up a mysql server to test,
but it should be just like that
Code:
SELECT * 
FROM (
	SELECT RANK() OVER(ORDER BY t.score DESC, t.CreatedDate DESC) AS globalRank, * 
	FROM (SELECT * FROM l4d2_srs.srs GROUP BY steamId) l4d2_srs.srs AS t) AS rt 
	WHERE rt.steamId = '%s')
You may need to remove 'AS' keyword which I have highlighted.
__________________

Last edited by pan0s; 10-27-2022 at 13:14.
pan0s is offline