【发布时间】:2013-08-28 12:45:51
【问题描述】:
我想要这样的东西。但我不知道正确的语法。
select id from table1
where name = (insert into table1 (name) values ('value_abcd'))
【问题讨论】:
-
我第一次使用 2 个查询插入到 table1 中,然后从 table1 中选择 col1。但我想要 1 个查询而不是 2..
-
INSERT语句不返回任何数据,因此您无法将其用作子查询。你到底想做什么? -
我想要这样的东西。但我不知道正确的语法...{ select id from table1 where name= (insert into table1 (name) values ('value_abcd')); }
-
您使用哪种语言访问数据库?
-
如果 sqlight 支持该功能,您可以使用触发器