现在要通过无重复选择entityid,通过实体ID插入数据,也就是如下数据
1 , 3, 5 | 2, 3, 5| 3,4,5|
第一条为主码 1,2,3,为主码
第二条3,3,4是实体ID
通过选择不同实体ID 3,4 插入两条数据 如: 4,3,1 | 5,4,1 主码是auto增长 大家有谁知道怎么写条sql语句
1 , 3, 5 | 2, 3, 5| 3,4,5|
第一条为主码 1,2,3,为主码
第二条3,3,4是实体ID
通过选择不同实体ID 3,4 插入两条数据 如: 4,3,1 | 5,4,1 主码是auto增长 大家有谁知道怎么写条sql语句
go
insert into tb
select 3,5 union all
select 3,5 union all
select 4,5
go
select * from tb
/*
id obj_id col
----------- ----------- -----------
1 3 5
2 3 5
3 4 5(3 行受影响)*/
go
drop table tb
select distinct entityid ,1 ..(其它你想设定的内容)..from table1
id 是自动增长 entityid 是 select 后面选的
帮忙修改下
attribute_info
select
distinct entityid, 0, 'Managed entity id', 2, 3, 0, ''
from
attribute_info