MySQL doesn't support TOP, however, there's a LIMIT syntax for MySQL that
roughly does the same thing:
http://www.mysql.com/doc/en/SELECT.html for a brief explanation.

In your example what you are looking for is:
 SELECT DateCreatedField
 FROM my_table
 ORDER BY DateCreatedField DESC
 LIMIT 10;


On Fri, 17 Oct 2003, Dale Hans wrote:

> Hi,
>
> I am trying to select the first 10 rows of a table by the date the
> record was created. I have a date field in the table and I tried using
> the TOP syntax of SELECT, but I keep getting syntax error.
>
> SELECT TOP 10 DateCreatedField
> FROM my_table
> ORDER BY DateCreatedField DESCENDING
>
> Does MySQL not support TOP?
>
> If it does, can somebody tell me what is wrong with that syntax?
>
> If it doesn't, can someone please tell how I can do it without getting
> ALL records and extracting the first 10 programmatically?
>
> Thanks,
> Dale Hans
>
>
>
>

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to