table or view does not exist
means that a table or view that you've specified in your SQL does not exist in the database (or it exists, but you don't have permission to access it).
That means that one of the following does not exist:
- mydb.testTable2
- bigdb.wtags
- bigdb.MASTERFILE
Aside from that, your query structure doesn't really make sense. As it is written, you are querying bigdb.wtags
and bigdb.masterfile
, but not using any of the results -- you are instead trying to insert from three other separate queries. I suspect you're trying to do something like:
insert into mydb.testTable2 (FAO, Company, Cost_Center, Description)
select bigdb.wtags.FAO,
bigdb.wtags.DESCRIPTOR,
bigdb.MASTERFILE.cost_center,
null
from bigdb.wtags
join bigdb.masterfile
on bigdb.wtags.fao = bigdb.MASTERFILE.workday_number
If you want to create a table as part of the insert, the syntax is slightly different:
create table mydb.testTable2 as
select bigdb.wtags.FAO,
bigdb.wtags.DESCRIPTOR,
bigdb.MASTERFILE.cost_center,
null description
from bigdb.wtags
join bigdb.masterfile
on bigdb.wtags.fao = bigdb.MASTERFILE.workday_number