日期:2014-05-17 浏览次数:20444 次
declare @rowid int set @rowid=2 select * from ( select * from a union all select * from b ) aa where rowid=2 order by 排序列
------解决方案--------------------
-----------sql中没有rowid,oracle中才有的。 -----------sql中的行号是,row_number select * from (select rowid=row_number() over(order by xh),* from( select * from goal union all select * from goal )tmp)tmp2 where rowid=1