日期:2014-05-19  浏览次数:20540 次

如何选取指定纪录?
比如,我要选取select   *   from   tbStu中第5条记录该怎么写?
谢了!

------解决方案--------------------
有标识列的话
select top 1 * from 表或查询结果集 where 标识列 not in (select top 4 标识列 from 表或查询结果集)
------解决方案--------------------
select did=identity(int,1,1),* into e from
(

select * tbStu1 UNION select * tbStu2

) t

select * from e
where did=5
drop table e
------解决方案--------------------
插入新表

select identity(int,1,1) id,* into #新表 from
(select * from tbStu1
union all
select * from tbStu2) t


select * from #新表
------解决方案--------------------
union会合并2条相同的记录
union all则不会,lz留意一下。