Please Help. insert data [message #372813] |
Sun, 11 March 2001 09:22 |
Lisa Stone
Messages: 3 Registered: February 2001
|
Junior Member |
|
|
I want to populate a temp table that lists employess that are not permanent. Table all_employees lists all employees and table permnent_employees liasts permanent employees. emp_id and emp_num form composite key in both the tables.
I've tried using minus for this, but error I get is :
ORA-00936: missing expression
Please help.
Here is the query Iam using :
insert into emps_temp(emp_id,emp_num) values
(select distinct emp_id,emp_num from all_employees
minus
select distinct emp_id,emp_num from permanent_employees)
|
|
|
Re: Please Help. insert data [message #372818 is a reply to message #372813] |
Mon, 12 March 2001 00:35 |
vishal gupta
Messages: 111 Registered: March 2001
|
Senior Member |
|
|
CYNO,
Do not use values in this statement. It will work. But i would advise you to add one more column in all_emp table indicating whether employee is permanent or temporary.
insert into emps_temp(emp_id,emp_num)
(select distinct emp_id,emp_num from all_employees
minus
select distinct emp_id,emp_num from permanent_employees)
Vishal
|
|
|
|