Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
仅当条件为真时,我才需要将值插入表中。
我尝试这样做:
select (case when a = b then insert into tbl values (1, 1) end) from dual;
但它不起作用:(
这样做: -
INSERT INTO tbl (column1, column2) VALUES( (SELECT column1 FROM table1 WHERE a=b), (SELECT column2 FROM table2 WHERE a=b) )
INSERT INTO tbl (column1, column2) SELECT column1, column2 FROM dual WHERE a=b