Avatar of PearlJamFanatic
PearlJamFanatic

asked on 

Get the top n, middle n and last n records from syabse and oracle DB

I don't mind if the queries are different for oracle and sybase. The value of n will always be less than 1/3rd of the rowcount (n<1/3rowcount) of the table.
I have considered the following
select top 100 * from table1 order by col1 desc
but it will not return records in the order they were inserted into the DB.
Oracle DatabaseSybase DatabaseDatabases

Avatar of undefined
Last Comment
awking00

8/22/2022 - Mon