|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
It is to my knowledge that there is a Limit command in SQL that limits the amount of records a query finds. How can I do this in Access?? Thanks for your help!
|
|
#2
|
|||
|
|||
|
Quote:
No, there is no limit function in the SQL standard. The standard way to limit a result is to use the row_number function. Access has another propietary function for this Code:
select top 7 aleb,caleb from ogrish order by aleb desc The limit is with regard to the order by clause. |
|
#3
|
|||
|
|||
|
SQL Server also uses TOP, why did you say "access has another function"? You mentioned a row_number function, can you post an example? Thx man.
|
|
#4
|
|||
|
|||
|
Check this website, URL Thats the place where I saw the LIMIT command but I suppose its only in MySQL, I was wondering if access had a similar command and I guess it is TOP. There is no way to randomize what is returned is there?
|
|
#5
|
|||
|
|||
|
example of the row_number function
Code:
select * from t where row_number() over(order by c1 desc) < 10 Code:
select * from ( select t.*,row_number() over(order by c1 desc) as rn from t ) dt where rn between 10 and 20 |
![]() |
| Viewing: Dev Shed Forums > Databases > MS SQL Development > Limiting Records |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|