What's wrong with this query? :(
#1

I don't know why but I can't make it work. Any idea why it's wrong?

PHP код:
mysql_format(mysqlQuerysizeof(Query), "SELECT `Name`,`Bank`, `Money` FROM `accounts` ORDER BY SUM(`Bank`+`Money`) DESC LIMIT 10"); 
Reply
#2

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)
Reply
#3

It works! Thanks bro
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)