View Single Post
DarkDeviL
SourceMod Moderator
Join Date: Apr 2012
Old 03-14-2016 , 05:01   Re: [CS:GO] Get Random Row from Database
Reply With Quote #5

Quote:
Originally Posted by Kailo View Post
em, this not sourcemod question, is't SQL. And if use google http://stackoverflow.com/questions/1...dom-row-in-sql
For MySQL:
Code:
SELECT column FROM table
ORDER BY RAND()
LIMIT 1
Now you're so smart to suggest Google, have you considered using Google yourself, to find out if "ORDER BY RAND()" could be a bad idea?

If you have a large database, such as player tracking (or store) databases, don't use "ORDER BY RAND()".
__________________
Mostly known as "DarkDeviL".

Dropbox FastDL: Public folder will no longer work after March 15, 2017!
For more info, see the [SRCDS Thread], or the [HLDS Thread].
DarkDeviL is offline