Re: About union sql Mysql 4.x

2005-12-05 Thread Michael Stassen
HALIL DEMIREZEN wrote: Michael, Thank you and all for effort to help.. I solved the problem by giving high limit numbers such as; (select * from tablea where item=1 order by rand() limit 0, 1) union all (select * from tablea where item != 1 order by rand() limit 0, 1);

Re: About union sql Mysql 4.x

2005-12-05 Thread Gleb Paharenko
-- > > > > > Gleb Paharenko <[EMAIL PROTECTED]> > 05.12.2005 12:19 > > To > mysql@lists.mysql.com > cc > > Subject > Re: About union sql Mysql 4.x > > > > > > > Hello. > > >

Re: About union sql Mysql 4.x

2005-12-05 Thread HALIL DEMIREZEN
46 To HALIL DEMIREZEN <[EMAIL PROTECTED]> cc Gleb Paharenko <[EMAIL PROTECTED]>, mysql@lists.mysql.com Subject Re: About union sql Mysql 4.x HALIL DEMIREZEN wrote: > Hi, > > I am trying to run an sql query such as below to list items=x randomly and > then items

Re: About union sql Mysql 4.x

2005-12-05 Thread Michael Stassen
HALIL DEMIREZEN wrote: > Hi, > > I am trying to run an sql query such as below to list items=x randomly and > then items != x randomly.. > > > mysql> (select * from tablea where item=1 order by rand()) union all > (select * from tablea where item != 1 order by rand()); > > but the result is not a

Re: About union sql Mysql 4.x

2005-12-05 Thread HALIL DEMIREZEN
] --- Gleb Paharenko <[EMAIL PROTECTED]> 05.12.2005 12:19 To mysql@lists.mysql.com cc Subject Re: About union sql Mysql 4.x Hello. >From http://dev.mysql.com/doc/refman/5.0/en/union.html: "ORDER BY for individual SELECT sta

Re: About union sql Mysql 4.x

2005-12-05 Thread Gleb Paharenko
Hello. >From http://dev.mysql.com/doc/refman/5.0/en/union.html: "ORDER BY for individual SELECT statements within parentheses has an effect only when combined with LIMIT. Otherwise, the ORDER BY is optimized away." Therefore you're getting the same results, because ORDER BY doen't wor

About union sql Mysql 4.x

2005-12-05 Thread HALIL DEMIREZEN
Hi, I am trying to run an sql query such as below to list items=x randomly and then items != x randomly.. mysql> (select * from tablea where item=1 order by rand()) union all (select * from tablea where item != 1 order by rand()); but the result is not as expected. rand() seems not to be wo