select identity(int,1,1) as iid,* into #tmp from 表 order by a desc,b desc,c desc,eupdate #tmp set d = iid
select * from #tmp
select * from #tmp
解决方案 »
- 在线求助!急急急!SQL基础问题!
- 表行转换成列求解读!
- JAVA --- 在一个面板里面完成增删改差功能
- 什么是catalog,schema??(尤其点点星灯,十年人生再请进,)
- 磁盘损坏,ndf丢失,如何恢复数据库?
- 请问如何修改分发服务器???
- 从两个表里汇总数量同时显示出来,sql语句如何写?
- 我想做两个数据表的交集,请帮忙看看.等待中。
- 课题怎么研究?
- 请帮我解析这条语句:select a.id,a.departID,c.role_id from a,b,c where a.username='A' and a.pwd='A' and a.departID=b.id and a.id*=c.user_id
- 求存储过程中的动态sql语句(在线等)
- 求一Sql语句,头痛ing.........
select identity(int,1,1) as iid,* into #tmp from 表 order by a desc,b desc,c desc,eupdate aa set aa.d = bb.iid
from 表 aa
join #tmp bb on aa.a = bb.a and aa.b = bb.b and aa.c = bb.c and aa.e = bb.edrop table #tmp