sql - how to insert records from one table to another selecting only the common columns -


i want insert records 1 table common columns

desc fp_mast        null?     type  emp_id              not null  varchar2(4)  emp_nm              not null  varchar2(35)  typ                 not null  varchar2(1)  flag                not null  varchar2(1)  st_dt               not null  date  end_dt                        date wk_dt               not null  date  

desc emp_mast null? type

emp_id              not null  varchar2(4)  emp_nm              not null  varchar2(35)  grd_cd              not null  varchar2(3)  desg_cd             not null  varchar2(2)  cost_sl             not null  varchar2(2)                  flag                not null  varchar2(1)  join_dt             not null  date  resig_dt                      date wk_dt               not null  date 

i tried query insert records did not work

insert fp_mast(emp_id,emp_nm,st_dt,end_dt,wk_dt) select(emp_no,emp_nm,join_dt,resig_dt,wk_dt) emp_mast emp_id in ('7996','7942','5251','7999','8249','6464','8220', '8221') 

it kept showing me following error

missing right parenthesis

thank you.

missing right parenthesis

because have syntax error in select statement.

change this:

select(emp_no,emp_nm,join_dt,resig_dt,wk_dt) 

to this:

select emp_no,emp_nm,join_dt,resig_dt,wk_dt 

you don't need parenthesis column names in select list. think got confused way values keyword used.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -