Hi Jay, thanks a lot for your help.

I tried it and it don´t work, but i tried other way that works fine. I´ll 
put it here because it could help other people.

select * from ( select g.grade_id as grade_id, concat(p.nome," 
",g.grade_subtitulo) as nome from grade g inner join produto p on 
g.produto_id=p.id where (select count(*) from produtos_lista pl where 
pl.grade_id=g.grade_id)=0 order by rand() limit 20) as t1 order by t1.nome

Thanks again.

""João Cândido de Souza Neto"" <[EMAIL PROTECTED]> escreveu na 
mensagem news:[EMAIL PROTECTED]
> Hi everyone,
>
> I´ve got a page where a ought to get 20 registers in ramdom order but i 
> want to display it in an alphabetical order.
>
> Someone knows if there is a way to get that 20 random registers in 
> alphabetical order?
>
> Thanks.
> 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to