What's wrong with this query? :( - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: What's wrong with this query? :( (
/showthread.php?tid=656268)
What's wrong with this query? :( -
Voluble - 11.07.2018
I don't know why but I can't make it work. Any idea why it's wrong?
PHP код:
mysql_format(mysql, Query, sizeof(Query), "SELECT `Name`,`Bank`, `Money` FROM `accounts` ORDER BY SUM(`Bank`+`Money`) DESC LIMIT 10");
Re: What's wrong with this query? :( -
SyS - 11.07.2018
SUM() function takes a column and returns the sum of all values in that column you should order it by (Bank+Money) instead of SUM(Bank+Money)
Re: What's wrong with this query? :( -
Voluble - 11.07.2018
It works! Thanks bro