Re: group by order by rand() problem

2004-04-02 Thread Alessandro Astarita
Alle 21:57, giovedì 1 aprile 2004, Michael Stassen ha scritto: You could probably accomplish this with a variant of the MAX-CONCAT trick http://www.mysql.com/doc/en/example-Maximum-column-group-row.html. Something like: SELECT user_id,

Re: group by order by rand() problem

2004-04-01 Thread Michael Stassen
Right. You're grouping by user_id and throwing in title, and you're hoping to influence which of the titles is chosen to go with user_id, but as title is neither part of your group nor part of an aggregate function, its value is undefined. See the manual for an explanation

RE: group by order by rand() problem

2004-03-31 Thread Dathan Vance Pattishall
Try seeding your rand. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 31, 2004 12:57 PM To: [EMAIL PROTECTED] Subject: group by order by rand() problem I have this table: mysql select * from banners;

RE: group by order by rand() problem

2004-03-31 Thread [EMAIL PROTECTED]
Try seeding your rand. Tried. It doesn't work. The select shows always the same records but in different order: SELECT * FROM banners GROUP BY user_id ORDER BY RAND(); first call ++-+---+ | id | user_id | title | ++-+---+ | 1 | 1 |

RE: group by order by rand() problem

2004-03-31 Thread m.pheasant
-Original Message- From: Dathan Vance Pattishall [mailto:[EMAIL PROTECTED] Sent: Thursday, April 01, 2004 7:16 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: group by order by rand() problem Try seeding your rand. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL