RE: Rand()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



select id, fname, lname, RAND() as temp from clients where featured=1 order
by temp



> -----Original Message-----
> I have the following query:
> 
> Select id, fname, lname from clients where featured=1 order by RAND()
> 
> At any time, there should only be three clients where featured =1.
> Problem is I have run this query several times yet it always returns
> them in the same order.  Not sure it makes a difference but the
> primary key is on the id column.  What am I doing wrong?
> 
> 
> Thanks!
> 
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux