MySQL Forums
Forum List  »  Newbie

Re: How to define TOP 5 records?
Posted by: Sergei
Date: June 16, 2005 04:28AM

When I tried do it in MySQL Query Browser it didn't work, but in SQLyog it runs well :)
I don't know that the reason was...

In Query Browser I could not excute all commands

DROP TABLE IF EXISTS temp_ttt;
CREATE TEMPORARY TABLE temp_ttt SELECT vote FROM ttt ORDER BY vote DESC LIMIT 5;
SELECT ttt.uid, ttt.uname Best, ttt.vote
FROM ttt
JOIN temp_ttt ON temp_ttt.vote = ttt.vote
ORDER BY ttt.vote DESC;

There an error was occured: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';
CREATE TEMPORARY TABLE temp_ttt SELECT vote FROM ttt ORDER BY vote DESC LIMIT' at line 1".

So I thank you for idea :)

Options: ReplyQuote


Subject
Written By
Posted
June 15, 2005 07:37AM
Re: How to define TOP 5 records?
June 16, 2005 04:28AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.