View previous topic :: View next topic |
Author |
Message |
Stacy
Joined: 12 Oct 2004 Posts: 9
|
Posted: Thu Feb 16, 2006 10:14 am Post subject: Selecet top 5 rows in MySQL? |
|
|
Hi All,
I'm using MySQL and ASP and I'm trying to come up with a SQL statement that selects only the 5 top results, from one of my MySQL tables. Is this possible to be done in MySQL or I'll have to select everything in the table and then just get the first 5 rows returned from the ASP code?
Thank you!
Stacy |
|
Back to top |
|
|
Don
Joined: 22 Oct 2004 Posts: 28
|
Posted: Thu Feb 16, 2006 1:43 pm Post subject: |
|
|
Yes you can do that with MySQL. It should be something like that:
SELECT * FROM tblYourTable LIMIT 0,5
Don |
|
Back to top |
|
|
Stacy
Joined: 12 Oct 2004 Posts: 9
|
Posted: Fri Feb 17, 2006 2:12 pm Post subject: |
|
|
Thanks Don,
If I execute the following MySQL statement, what will it do:
SELECT * FROM tblYourTable LIMIT 4,5
Would it get rows # 4 and 5?
Thanks again, |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group
|