只需要知道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
我没有尝试使用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)