Leakbali
w3 Tutorial, Web Tutorial
Register   Login
Share

MySQL Top 


The TOP clause is used to specify the number of records to return. The TOP clause can be very useful on large tables with thousands of records. Returning a large number of records can impact on performance.

MySQL Top Syntax

SELECT column_name(s) FROM table_name LIMIT number

MySQL Top Example

SELECT *FROM Persons LIMIT 5
The "persons" table:
IDFirst NameLast NameAddress
1PutuSanjayaDenpasar
2MadeSanjayaSanur
3HaruSanjayaGianyar
Now we want to select only the two first records in the table above. We use the following SELECT statement:
SELECT *FROM Persons LIMIT 2
The result-set will look like this:
IDFirst NameLast NameAddress
1PutuSanjayaDenpasar
2MadeSanjayaSanur
More Tutorial
  1. MYSQL - MySQL Top

References

About Us

Home
About Us
Contact Us
Sitemap

Tools

Google PageRank
Alexa Rank
Keywords Density

Accounts

Register Account
Login
Valid XHTML 1.0 TransitionalValid CSS!
Web Directory


2006 - 2012 © Leakbali.com - Free Web Tutorial, Free Web Articles, Web Sharing, Source Codes, Web References