Using subquery in a insert statement.
777326Jun 5 2010 — edited Jun 7 2010Hello All,
I read in a book that you can't use subquery in an insert statement . E.g:
1)insert into dates (date_col) values (select sysdate fom dual)
but when i tried using subquery like this:
2)insert into regions values ((select max(region_id)+1 from regions), 'Oce');
This query worked but 1st query didnt.From my assumptions if we try inserting values in table with the subqueries
for a particular column as in 1st query , it will throw error but not while inserting values in all columns as in 2nd query.
Please explain if my assumptions are correct or not. Also please clarify.