|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: Making ORDER BY RAND() more random [resend]
From: Henry Wong (hwong
dja.com)
Date: Mon Oct 03 2005 - 12:10:57 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
change the seed on the random function.
http://dev.mysql.com/doc/mysql/en/mathematical-functions.html
On Mon, 2005-10-03 at 08:33 -0700, Graham Anderson wrote:
> is there a way to make ORDER BY RAND() at bit more spontaneous ?
>
> I am using it in a php statement:
> $sql = "SELECT media.id,
> artist.name as artist,
> artist.spanish as bio,
> artist.purchaseLink,
> artist.picture,
> media.spanish as trackName,
> media.path,
> media.quality,
> mediaType.id as mediaType
> FROM artist, media, playlistItems, mediaType
> WHERE playlistItems.playlist_id = $myID
> AND playlistItems.media_id = media.id
> AND media.artist_id = artist.id
> AND media.mediaType_id = mediaType.id
> ORDER BY RAND() LIMIT 0, 30";
>
>
> the result seems to be pretty predictable ....
> is there a way to improve RAND() or is there something better ?
> Should I be using php to randomize the found set instead ?
>
>
> many thanks
> g
>
>
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe: http://lists.mysql.com/mysql?unsub=grahama
siren.cc
>
>
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]