有两个表
tableA tableB
ID title type taID myID
1000 ****** 'AAA' 1000 33333
1001 ****** 'AAA' 1001 33333
1002 ****** 'AAA' 1002 33333
1003 ****** 'BBB' 1003 44444
1004 ****** 'BBB' 1004 44444
……我要把tableA中的type为'AAA'的ID值选择出来,然后插入到tableB中的taID,tableB的myID 为某一固定值,这种批量插入该怎么写?
tableA tableB
ID title type taID myID
1000 ****** 'AAA' 1000 33333
1001 ****** 'AAA' 1001 33333
1002 ****** 'AAA' 1002 33333
1003 ****** 'BBB' 1003 44444
1004 ****** 'BBB' 1004 44444
……我要把tableA中的type为'AAA'的ID值选择出来,然后插入到tableB中的taID,tableB的myID 为某一固定值,这种批量插入该怎么写?
select ID,'11111'
from tableA
where type = 'AAA'
select [id],'固定值' from tableA where type='AAA'