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);
--
>
>
>
>
> Gleb Paharenko <[EMAIL PROTECTED]>
> 05.12.2005 12:19
>
> To
> mysql@lists.mysql.com
> cc
>
> Subject
> Re: About union sql Mysql 4.x
>
>
>
>
>
>
> Hello.
>
>
>
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
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
]
---
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
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
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