Subject | First and Last |
---|---|
Author | gorepj |
Post date | 2004-05-07T19:17:45Z |
Hi all,
Is there a way I can select the first X and last X rows from a table
in a single query?
For instance, something like
SELECT FIRST 10 * FROM Mytable ORDER BY 1 ASC
UNION
SELECT FIRST 10 * FROM Mytable ORDER BY 1 DESC
This doesn't work because you can't have two order by clauses in
the same query. So is there alternative way?
Regards
Peter Gore
Is there a way I can select the first X and last X rows from a table
in a single query?
For instance, something like
SELECT FIRST 10 * FROM Mytable ORDER BY 1 ASC
UNION
SELECT FIRST 10 * FROM Mytable ORDER BY 1 DESC
This doesn't work because you can't have two order by clauses in
the same query. So is there alternative way?
Regards
Peter Gore