| List: | General Discussion | « Previous MessageNext Message » | |
| From: | Alessandro Astarita | Date: | April 2 2004 9:19am |
| Subject: | Re: group by & order by rand() problem | ||
| View as plain text | |||
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, > SUBSTRING(MAX(CONCAT(TRUNCATE(RAND(),4),title)),7) AS Title > FROM banners > GROUP BY user_id; Thank you so much. This solution works correctly. -- Alessandro 'Asterix' Astarita <aleast@stripped> CapriOnLine S.r.l. http://www.caprionline.com/ "Unix IS user friendly. It's just selective about who its friend are"
| Thread | ||
|---|---|---|
| • group by & order by rand() problem | aleast@capri.it | 31 Mar |
| • RE: group by & order by rand() problem | Dathan Vance Pattishall | 31 Mar |
| • RE: group by & order by rand() problem | m.pheasant | 1 Apr |
| • Re: group by & order by rand() problem | Michael Stassen | 1 Apr |
| • Re: group by & order by rand() problem | Alessandro Astarita | 2 Apr |
| • RE: group by & order by rand() problem | aleast@capri.it | 31 Mar |
