If you have a field 'weight', you could SELECT *, RAND()*weight AS r FROM table_name ORDER BY r
(Or you can complicate the expression more :-) laszlo Ed Lazor wrote: Ed Lazor wrote: > I found this: > SELECT * FROM table_name ORDER BY RAND() > > Is there a way to weight the random selection so that certain records are > more likely to come up? > > It's for a banner exchange program. The idea is to somehow give precedence > to help promote certain sites. > > Thanks! =) > > -Ed > > --------------------------------------------------------------------- > Before posting, please check: > http://www.mysql.com/manual.php (the manual) > http://lists.mysql.com/ (the list archive) > > To request this thread, e-mail <[EMAIL PROTECTED]> > To unsubscribe, e-mail <[EMAIL PROTECTED]> > Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php