編號(varchar) 序號(int) XXXXXX XXXXX -----------------------------------------select 排出来的序号=(select count(1) from 表名 where 编号=a.编号 and 序号<=a.序号),* from 表名 a
也许大家还不明白我的意思 我是想 insert into 表 select XX from tb where ......其中select XX from tb where 这句是要产生多笔记录,其中一列就是按1、2...这样排
-->用数字辅助表,假设你每条记录要插100次: select top 100 id=identity(int,1,1) into # from syscolumns, sysobjectsinsert into 表(序号,...) select b.id, a..... from tb a, # b
select 编号,row_number() over(order by 编号) as 序号,xx
from tb1
goinsert into tName(編號,XXXXXX,XXXXX) select ......
go
goinsert into tName(編號,XXXXXX,XXXXX) select ......
go
能否詳細說下A.coll
編號(varchar) 序號(int) XXXXXX XXXXX
-----------------------------------------select 排出来的序号=(select count(1) from 表名 where 编号=a.编号 and 序号<=a.序号),* from 表名 a
我是想
insert into 表
select XX from tb where ......其中select XX from tb where 这句是要产生多笔记录,其中一列就是按1、2...这样排
-->用数字辅助表,假设你每条记录要插100次:
select top 100 id=identity(int,1,1) into # from syscolumns, sysobjectsinsert into 表(序号,...) select b.id, a..... from tb a, # b