I am using the below Query to try to insert a few rows from table2 in Database2 into table1 from Database1. Both these tables have different schemas.
Both the tables have same structure. I did check other posts with a similar query to no avail. Used the below basic approach :
INSERT INTO remoteDATABASE.remoteSCHEMA.remoteTABLE
SELECT * FROM localTABLE
INSERT INTO 'eno*****.com'.asdf_stage.temp
SELECT i.artf_id as id,
title as description,
(case
when i.assigned_group = 'asdfk' then 'dfg'
when i.assigned_group = 'dfgdg' then 'dgdk'
when i.assigned_group = 'dfghdgf' then 'igo'
when i.assigned_group = 'dfgh' then 'eMgem'
when i.assigned_group = 'Edsfg' then 'esgd'
end ) as area,
"N/A" as disposition,
"********" as flavor,
"ipf" as link,
"*************" as vendor,
DATE(date_created) date,
DATE(close_date) as completed
FROM ******com.lkjhg_stage.issues i
where date(date_created) >'2018-04-01' AND status!='Rejected'
I am getting syntax error, need to know what is the correct syntax to mention the DB name , Schema name and the table name at both the places. Also, the table has around 10-15 columns , do I need to specify all of them ?