INSERT INTO account_type_standard
(account_type_Standard_id, tax_status_id, recipient_id)
VALUES(
(SELECT account_type_standard_seq.nextval FROM DUAL),
(SELECT tax_status_id FROM tax_status WHERE tax_status_code = ?),
(SELECT recipient_id FROM recipient WHERE recipient_code = ?)
)
출처 : http://stackoverflow.com/questions/131164/oracle-insert-via-select-from-multiple-tables-where-one-table-may-not-have-a-row
UPDATE TEST
SET
COL1 = (SELECT COUNT(*) FROM TEST1 WHERE ID =1),
COL2 = (SELECT COUNT(*) FROM TEST2 WHERE ID =1)
WHERE ID = 1;
댓글