mysql query error
#1

Actually this is the bug...

this is my mysql query
Код:
format(str,sizeof(str),"SELECT `Id` FROM `clans` ORDER BY `Clanscore` DESC LIMIT %d,1",listitem);
the 0,1 should return the value in 0'th row right? but it's returning the id of 5'th row!ut

Pics:



But the error is

Reply
#2

I fail to see the problem. You're ordering by "ClanScore", but since all values are 0 MySQL is free to order it in whatever way it wants, which is apparently descending by id. The limit clause is the very last thing that gets applied and what "limit 0,1" actually means is: start with the 0th result in the result set and get the next 1 rows.
Reply
#3

thanks alot vince, its working!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)