To get top 3 records in mysql connectivity
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Ashok_Rajamanickam
Posted On:   Tuesday, July 20, 2004 10:00 PM

What is the query to get top 3 records using mysql-JDBC connectivity. It is available in Microsoft SQL - "select top 3 * from database". But I want it for MySql. Can anybody help me?

Re: To get top 3 records in mysql connectivity

Posted By:   Simon_Ablett  
Posted On:   Wednesday, July 21, 2004 03:40 AM

If by 'top 3 records' you mean the first three then get a result set and iterate through for three iterations. I don't believe that MySql supports the 'limit to' command. Note that the first three records will obviously change according to the criteria specified in your 'WHERE', 'ORDER BY' or 'GROUP BY' clauses.

Regards.
About | Sitemap | Contact