Using TOP Clause in MYSQL (1 Viewer)

RajaGautam

Registered User.
Local time
Today, 15:41
Joined
Apr 5, 2013
Messages
10
Hi! I want to use TOP Clause in MySQL but i'm unable to do it. The SQL Statement is as below:

SELECT TOP * FROM Persons

It display the error saying:

[FONT=&quot]
#1064 - 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 '2 * from persons LIMIT 0, 30' at line 1[/FONT]
[FONT=&quot]
MySQL version is 5.5.27. Please help me to penetrate the above query in MySQL?


[/FONT]
 
Last edited:

pbaldy

Wino Moderator
Staff member
Local time
Today, 02:56
Joined
Aug 30, 2003
Messages
36,118
As is, using TOP makes no sense. Normally

SELECT TOP x

Where x is a number or percent, like

SELECT TOP 10

You'd typically also have an ORDER BY clause to give the TOP predicate meaning.

My daughter lived in Kathmandu for a year; recently moved from there to New Zealand.
 

Users who are viewing this thread

Top Bottom