MSSQL

Aus crazylinux.de
Zur Navigation springen Zur Suche springen

This query gives you the same ability as a LIMIT clause does in MySQL and Oracle for MS SQL Server without the headaches of stored procedures or temp tables.

select * from (
select top 10 emp_id,lname,fname from (
select top 30 emp_id,lname,fname
from employee
order by lname asc
) as newtbl order by lname desc
) as newtbl2 order by lname asc

from: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=850&lngWId=5