立即结贴给分,数据库中取值问题!! select top 2 * into #temp from tableset rowcount 2-1delect * from #tempselect * from #temp 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 alter table add cid int identity(1,1)select * from table where cid=2alter table drop column cid alter table add cid int identity(1,1)select * from table where cid=2alter table drop column cid OR:select identity(int,1,1) id,* into #temp from tableselect * from #temp where id=2 select top 1 * from (select top 2 * from yourtable order by begindate) as Aorder by A.begindate desc alter table add cid int identity(1,1)select * from table where cid=2alter table drop column cid I WILL TRY IT.IF IT CAN BE RUN,I WILL GIVE YOUR POINTS. 想学习查询优化,有哪本资料呢 sql 处理结果集 这个要怎么做,高手请进? 大家看看触发器这样写会不会有问题?会不会造成死循环? 存储过程的问题,怎样把字符串转成变量? SQL触发器怎么导出?? 论坛的排行榜的sql语句 更新 和删除添加的效率 关于dbgrid的小问题 如果Sybase数据库表中存在identity字段,MFC ODBC的CRecordset怎么处理? 异地备份怎么做?谢谢! 数据恢复
select * from #temp where id=2
(select top 2 * from yourtable order by begindate) as A
order by A.begindate desc
IF IT CAN BE RUN,I WILL GIVE YOUR POINTS.