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 -> Help inserting values into table using a subquery

Help inserting values into table using a subquery

From: D Newsham <d_newsham_at_hotmail.com>
Date: 6 Feb 2003 14:58:58 -0800
Message-ID: <c883e8dd.0302061458.553f71f1@posting.google.com>


Hi,

I need to match up a column in two of my tables. Running the following query:

select id from table1
where id not in (select id from table2))

returns 44 rows. I need to have table2 contain the exact same number of rows and id numbers as table1. I tried running this insert statement:

insert into table2(id) values(select id from table1 where id not in (select id from table2))

but get the error:



insert into table2(id) values(select id from table1
                                        *
ERROR at line 1:
ORA-00936: missing expression

Is it possible to use a subquery to insert several values?

Thanks
D. Received on Thu Feb 06 2003 - 16:58:58 CST

Original text of this message

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