sql自增表的创建问题? 请问如何实现创建一个可以实现里面的数据自动增加的sql server表,实现当取出里面的数据后,该数据自动加1,之后再取的话,就是加一后的数据。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 create table tb(id int identity , val int) create table tb(id int identity , val int) 我就要一个值,取出来之后,自动更新为原值加1----自增列已经能满足你的需求.或者select isnull(max(id),0) + 1 from tb create table #(id int)insert # select 0godeclare @id intupdate # set @id=id=id+1select @id -->1godeclare @id intupdate # set @id=id=id+1select @id -->2godrop table # 求语句 如何从数组arraylist中查询数据? 一个很有用的查询问题 怎样查找表中的第N条记录? 应该做像百度新闻那样查询新闻,还取出相同新闻标题的行数 我遇到了难题 求一sql 语句 紧急求助:State 42000,Native:18456(很急) PBABI:请进来。借点分你用:)没试过,不知道可不可以。 那里找的到sql server~为什么我调试不了ASP程序?~! 往一个大数据量表插入数据时为什么很慢??索引的问题吗?? 急
create table #(id int)
insert # select 0
godeclare @id int
update # set @id=id=id+1
select @id -->1
godeclare @id int
update # set @id=id=id+1
select @id -->2
godrop table #