|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Hi,
Im new to the forum so I hope I am posting it in the right place... Is there a way to constraint the number of tuples returning form a query? I have a database with about 20000 tuples. When asking the simple query: select * from table, is there a way to return only the first 1000 tuples? Thanks in advance, ayab ![]() |
|
#2
|
|||
|
|||
|
Yes there is:
Select * from table limit 1000; This will give you the top 1000 from the resultset. You can use limit to do scrolling in resultsets too. For instance: You want the first 5 rows, and then the next 10: Code:
select * from table limit 5; select * from table limit 5,10; The second parameter will be the number of results returned, the first one is the offset. So, in this case: start from number 5, so skip 5, return the next 10. Results numbers 6-15 will be returned here. Hope this helps! |
![]() |
| Viewing: Dev Articles Community Forums > Databases > MySQL Development > putting constraints on the number of tuples |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|