At 13:26 -0700 5/14/02, Soheil Shaghaghi wrote:
>Hello All,
>I am running 2 MySQL servers, one on Linux, and the other on FreeBSD.
>Linux, MySQL version: 3.23.49
>FreeBSD, MySQL version: 3.22.32
>
>Problem:
>
>The following code runs on the newer version of MySQL, and Linux, but when I
>run it on the other server, I get sql error.
>
>SELECT ID,Headlines,IsActive FROM DATABASE WHERE IsActive=1 ORDER BY RAND()
>LIMIT 1
>
>Can anyone please tell me if it's the version of MySQL causing this problem
>or something else?
Yes. Expressions in the ORDER BY clause are not supported prior to 3.23.2.
>
>Is there anyway to get around this, without upgrading MySQL?
SELECT ID*0+RAND() AS r, ID, Headlines, ... ORDER BY r LIMIT 1;
>
>Thanks so much,
>Soheil