select identity(int,1,1) as id into tmp from test where .. order by code select code,name,identity(int,1,1) as id into tmp from test where .. order by code这样不行吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select code,name,identity(int,1,1) as id from test where .. order by code into tmp select identity(int,1,1) as id,* into tmp from test where .. order by code ???select identity(int,1,1),*from (select * from test where .. order by code) to psxfghost: 谢谢你的回复.不行呀,结果:code name id-------------------------- BDJB 病毒警报 1 YCYKX 越策越开心 2 RXBS 人性本善 3 MLSZ 美丽使者 4 select a.* into tmp from (select code,name,identity(int,1,1) as id from test where .. order by code) as a这样应该可以吧 fcuandy请来领分! 如何设计并计算作业里的调度。我要按照用户设置的周期定期插入数据 先判断后更新的问题 JDBC更新一个大表的速度怎么那么慢? 简单的问题 初学sql server 想找一本比较好的指导书,万分感谢!!! 急急急!!! 分区函数怎么使用双主键来分区? 这种情况下我如何将数据库备份? 200分求解决:System.Data.SqlClient.SqlException: SQL Server 不存在或访问被拒绝。 另一张表中的某列的值如果都固定,则不在这查询出来 有三个字段,分别表示年月日,是整型的。问怎么样把日期是当天日期的记录找出来 sql一道!
select identity(int,1,1),*
from (select * from test where .. order by code)
code name id
--------------------------
BDJB 病毒警报 1
YCYKX 越策越开心 2
RXBS 人性本善 3
MLSZ 美丽使者 4
这样应该可以吧