在Informix中仅为一列插入select语句

sri*_*ath 3 sql informix

只需要知道Informix中是否可以进行此查询.

insert into emp(emp_id, sal, desg)
values (111, (select salary from emp_sal where emp_id=222), 'xxx');
Run Code Online (Sandbox Code Playgroud)

表结构是:

emp:emp_id,name,sal,desg

emp_sal:emp_id,sal

Tho*_*ler 8

我没有尝试使用Informix,但大多数数据库都支持insert into ... select:

insert into emp(emp_id, sal, desg) 
select 111, salary, 'xxx' 
from emp_sal where emp_id = 222;
Run Code Online (Sandbox Code Playgroud)