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() problemaleast@capri.it31 Mar
  • RE: group by & order by rand() problemDathan Vance Pattishall31 Mar
    • RE: group by & order by rand() problemm.pheasant1 Apr
      • Re: group by & order by rand() problemMichael Stassen1 Apr
        • Re: group by & order by rand() problemAlessandro Astarita2 Apr
RE: group by & order by rand() problemaleast@capri.it31 Mar