Oracle insert select tips
want to do an Oracle insert by selecting rows from a related table.
How does the Oracle insert select SQL work?
SQL allows for you to perform a SQL insert operation with a
insert /*+ append */ into
select name, salary from emp where dept = ‘FINANCE’;
Also see these tips for
slow insert select statements.
Insert select statements can
also use scalar subqueries for inserting into tables with values
based on other tables. Below we use an insert select with a scalar
subquery to compute the maximum credit for BILL and insert this
value into a max_credit table.
max(credit) from credit_table where name = ‘BILL’
For complete details see the book
Get the Complete
Oracle SQL Tuning Information
The landmark book
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
for 30% off directly from the publisher.