如果9、10、11工资都一样的情况都算是前10的话,还可以用如下的方法
select * from T where
(select count(1) from T T1 where T1.salary > T.salary) <= 9
or
(select count(1) from T T2 where T2.salary < T.salary) <= 9
--一樓的寫法不正確的,union中不能2個order by
--用臨時表好了
select * into #t1 from (select top 10 * from T order by 工资 desc) A
select * into #t2 from (select top 10 * from T order by 工资) B