Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> What is the Purpose of Subquery in Insert?

What is the Purpose of Subquery in Insert?

From: Den <dd_at_hotmail.net>
Date: Fri, 18 Feb 2005 16:44:39 +0800
Message-ID: <4215aaf7$1_3@rain.i-cable.com>


This statement is found in oracle's training material:

INSERT INTO (SELECT employee_id, last_name

           FROM employee
          WHERE department_id=50)

VALUES(9999,'peter');

The above subquery is interpreted as the list columns to be inserted with values. But what is the point of having this syntax? And why bother putting in a WHERE clause? Isnt it good enough to list just the column names instead of a doing a subquery which is nothing more than indicating what columns are involved?? Received on Fri Feb 18 2005 - 02:44:39 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US