【发布时间】:2010-10-06 06:19:48
【问题描述】:
我想写
insert into tbl1(a,b)
select 123, (select id from tbl2 where status=987)
问题是,只插入一行而不是多行。我该如何解决? 使用 Sqlite。
【问题讨论】:
标签: sqlite bulkinsert
我想写
insert into tbl1(a,b)
select 123, (select id from tbl2 where status=987)
问题是,只插入一行而不是多行。我该如何解决? 使用 Sqlite。
【问题讨论】:
标签: sqlite bulkinsert
为什么不:
insert into tbl1(a,b)
select 123, id
from tbl2
where status = 987;
?
【讨论】:
你试过了吗?
insert into tbl1(a,b)
select 123, x.*
from (select id from tbl2 where status=987) x
【讨论】: