0 pts.
 INSERT WITH SELECT (CAN’T SEEM TO FIND EXPLANATION)
SQL
Can someone please explain the INSERT syntax that is in the Oracle Database 10g SQL class. I can't seem to find anyone who knows. An example of the statement that I don't understand is: INSERT INTO (SELECT last_name, salary FROM EMPLOYEES WHERE department_id = 50) VALUES (... What is the SELECT statement in the INSERT clause of the INSERT statement doing? Thanks for any help anyone can give me. Linda

Software/Hardware used:
ASKED: June 19, 2006  1:18 PM
UPDATED: June 20, 2006  10:27 AM

Answer Wiki:
The SELECT statement is defining the column order for the VALUES and the TABLE to use. It has the same effect as INSERT INTO employees (last_name,salary) VALUES ... The WHERE clause does not have any effect on column selection nor does it provide a default value for department_id. Tested on: OracleXE for Windows 10gR2 Regards Peter Wilkinson Senior Oracle DBA Mercury International Ltd
Last Wiki Answer Submitted:  June 20, 2006  10:27 am  by  Psw2000   0 pts.
All Answer Wiki Contributors:  Psw2000   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _