At 11:25 AM 7/7/2006, you wrote:
I think you meant ORDER BY `registers`..
He may have meant that but then you lose the randomness.
I think it has to be done in 2 steps. I don't see any way of doing it
without creating a temporary table.
The SQL might look something like this:
drop temporary
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.pro
I think you meant ORDER BY `registers`..
Jay Blanchard пишет:
[snip]
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?
[/snip]
SORT BY `
[snip]
Excuse me, but i don´t understand your answer.
Could you explain it?
[/snip]
Add it to the end of your query
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Excuse me, but i don´t understand your answer.
Could you explain it?
""Jay Blanchard"" <[EMAIL PROTECTED]> escreveu na mensagem
news:[EMAIL PROTECTED]
[snip]
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 t
[snip]
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?
[/snip]
SORT BY `registers`
--
MySQL General Mailing List
For list archives: http:/
Hi Payne,
This is probably because of a bug in MySQL versions before 3.23.56 and
4.0.10 -- RAND() didn't work right the first time it was used in a *new*
connection. After the first run, though, it was OK.
To work around the problem, I've told people to just call RAND() a few
times before doing y
On Fri, Feb 28, 2003 at 05:19:15PM +1100, Justin French wrote:
> Hi all,
>
> On my LAN server (FreeBSD, MySQL 3.32) the following query works fine, and
> seems to return 2 random rows from the table:
>
> SELECT * FROM disc ORDER BY RAND() LIMIT 2
>
> However, when I upload the scripts to the liv
hi guys i just tried this on my works old mysql server and it doesnt seem to work , is
it possible ? :|
-
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the
Hi!
On Feb 05, Tue Tønning wrote:
> Hey,
>
> I have discovered a strange error in the mysql versions mentioned in subj.
>
> Example.
> A table with 10 entries ...i want to draw 3 randomly
> => "select fieldName from tableName order by RAND() limit 3"
>
> this have worked for the last year or so
HINT:
I have used PERL to generate random numbers and then do a SELECT on the
auto_increment field in the mysql table, thus generating random picks from
my tables;
I'll be glad to bet informed of better ways around, though :)
Thanks
Aman Raheja
AGF Inc.
- Original Message -
From: "Tue Tøn
L List [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, June 27, 2002 2:44 PM
> To: Jon Frisby
> Cc: mysql
> Subject: Re: Rand slowness.
>
>
> I tried this, but it seems to be ignoring the LIMIT 3, since it
> is returning
> all the rows.
>
>
> > Try:
> >
I tried this, but it seems to be ignoring the LIMIT 3, since it is returning
all the rows.
> Try:
> SELECT RAND() AS r, * FROM table ORDER BY r LIMIT 3;
>
> Off the top of my head, I'd guess that the reason for the slowdown has to
do
> with MySQL doing a new RAND() call for every comparison in t
You can't do "ORDER BY RAND()" prior to version 3.23...
On your 3.22.32 version do something like:
SELECT column_name*0+RAND() AS rnd FROM table_name WHERE IsActive=1 ORDER
BY rnd LIMIT 1;
Gurhan
-Original Message-
From: Soheil Shaghaghi [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 1
At 13:26 -0700 5/14/02, Soheil Shaghaghi wrote:
>Hello All,
>I am running 2 MySQL servers, one on Linux, and the other on FreeBSD.
>Linux, MySQL version: 3.23.49
>FreeBSD, MySQL version: 3.22.32
>
>Problem:
>
>The following code runs on the newer version of MySQL, and Linux, but when I
>run it on
15 matches
Mail list logo