插入多条记录时,其中一个字段以-1开始递减,如何写SQL? 如题这多条记录是从另一个表中提取的。递减字段是新表中存在的字段。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select ID,identity(-1, -1) as id2 from table 提示-附近有语法错误。 create table ff(id int identity(-1,-1),bb int)insert into ff(20) insert into ff values(20) select ID,identity(-1, -1) as id2 from table 提示-附近有语法错误。-------------这样的:select ID,identity(int,-1, -1) as id2 from table 晕,上面写的不对要么再建表的时候create table tb(a int identity(-1,-1),b int)或者select ID,identity(int,-1, -1) as id2 into # from tableselect * from # insert table2 ( select ID,identity(int,-1, -1) as id2 into # from table)出错。 如何为已有字段添加自动增长 自連接問題 特别奇怪的问题:DTS中,空格为什么被去掉了? 这个SQL语句可以写出来吗? 极度迷茫中 修改多个表中同一字段中的记录???? update问题 sqlservr.exe占用cpu98%是怎么回事? happydreamer(黑DD) ,pengdali(大力) ( ) 請進 两个500W数据量的表关联更新问题 请教思路:在Foxpro里做一个学生成绩的数据库,一定给分! 查询分析器里怎样修改存储过程? sum 怎么会自己 四舍五入 呢?
-------------
这样的:
select ID,identity(int,-1, -1) as id2 from table
要么再建表的时候create table tb(a int identity(-1,-1),b int)
或者select ID,identity(int,-1, -1) as id2 into # from table
select * from #
出错。