Using TOP Clause in MYSQL (1 Viewer)

RajaGautam

Registered User.
Local time
Today, 10:03
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:
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

Back
Top Bottom