Is there a way in MySQL to limit how many results are shown?
SELECT * FROM tbl;
but I only want say, 25 results. Is this possible?
Limit number of listings
Started by
Guest_NeedHelp_*
, Jul 14 2006 08:32 AM
4 replies to this topic
#1
Guest_NeedHelp_*
Posted 14 July 2006 - 08:32 AM
Guest_NeedHelp_*
|
|
|
#2
Posted 15 July 2006 - 05:26 PM
Yup, just add a LIMIT 0,25
The 0 is where to start and the 25 is the max number of results.
The 0 is where to start and the 25 is the max number of results.
for (int i;;) {
cout << "Smith";
}
#3
Posted 15 July 2006 - 05:27 PM
#4
Posted 16 July 2006 - 09:17 PM
I know there is a command for Top 10 or something.. how does that one work?
Sorry to slightly stray here, but it is still kind of relevant.
Sorry to slightly stray here, but it is still kind of relevant.
#5
Guest_Jordan_*
Posted 17 July 2006 - 04:52 AM
Guest_Jordan_*
You can do a ORDER BY to get the top ten combined with limit
SELECT * FROM tbl ORDER BY clm_num LIMIT 0,10;
Do to in reverse order do
SELECT * FROM tbl ORDER BY clm_num LIMIT 0,10 DESC; // Descending Order
You can also ORDER by multiple columns in your table
SELECT * FROM tbl ORDER BY clm_num, clm_name LIMIT 0,10;
If the column is character it will be sorted alphabetical.
SELECT * FROM tbl ORDER BY clm_num LIMIT 0,10;
Do to in reverse order do
SELECT * FROM tbl ORDER BY clm_num LIMIT 0,10 DESC; // Descending Order
You can also ORDER by multiple columns in your table
SELECT * FROM tbl ORDER BY clm_num, clm_name LIMIT 0,10;
If the column is character it will be sorted alphabetical.


Sign In
Create Account

Back to top










