Home » RDBMS Server » Server Administration » Please Help. insert data
Please Help. insert data [message #372813] Sun, 11 March 2001 09:22 Go to next message
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 Go to previous messageGo to next message
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
Re: Please Help. insert data [message #372819 is a reply to message #372813] Mon, 12 March 2001 00:48 Go to previous message
selvakumar
Messages: 3
Registered: March 2001
Junior Member
please help me
Previous Topic: Urgent
Next Topic: Calling Functions within a CREATE Statement
Goto Forum:
  


Current Time: Sat Jun 29 13:43:52 CDT 2024