Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Select Top (all but 10) from ... in Microsoft Access

Tags:

sql

jet

ms-access

Say I've got a query

SELECT TOP 10 ... FROM ... ORDER BY ...

in Access (well, really Jet). The question is: how can I get all the other rows... everything except the top 10?

like image 707
Joel Spolsky Avatar asked Feb 05 '09 21:02

Joel Spolsky


1 Answers

Couldn't you do something like

SELECT ... FROM ...
WHERE PK NOT IN (SELECT TOP 10 PK FROM ...)
ORDER BY ...

it might not be that efficient but that's the only way off the top of my head I can think to do something like that. AFAIK there's no "BOTTOM" clause in SQL :)

like image 171
Wayne Molina Avatar answered Oct 10 '22 04:10

Wayne Molina