我有一张桌子Ty
包含:
a integer NOT NULL,
b text,
c text,
d text,
e text
我正在尝试按以下方式插入声明:
insert into Ty (b,c,d,e) values
('hello','world',select current_date,select name from users where userid=4)
但这是行不通的。它说:
错误:“选择”或附近的语法错误
我阅读的所有指南都说,只要它们仅返回一个值,我就可以在Insert中执行SQL语句。那为什么不起作用呢?
insert into Ty (b,c,d,e)
SELECT 'hello','world',current_date, name from users where userid=4
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句