problem with RAND function

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

problem with RAND function

Post by mzfp2 »

hi the following query runs perfect on my machine which has MYSQL

SELECT * FROM banners ORDER BY RAND() LIMIT 1

however when testing the same query on my host which has MYSQL also, it always returns the same row

are there version differences, or can some hosts prevent the RAND function from being used?
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

It's a MySQL version specific thing, have a read of:
http://www.mysql.com/doc/en/Mathematica ... ml#IDX1273

and the user notes.

Mac
mzfp2
Forum Contributor
Posts: 137
Joined: Mon Nov 11, 2002 9:44 am
Location: UK
Contact:

Post by mzfp2 »

It seems my host probably has MYSQL < 3.23 .. so how can the same query be executed on MYSQL version previous to 3.23?
Post Reply