Home > other >  Getting a syntax error for trying to get values from two different databases
Getting a syntax error for trying to get values from two different databases

Time:09-28

select * 
from DB1.schemaA.table1 as t1
outer join DB2.schemaA.table1 as t2
on t1.ID = t2.ID

error being - Incorrect syntax near the keyword 'join'

CodePudding user response:

The outer join query syntax is not correct, please use full outer join

Since you didn't mention which SQL database being used, so here is a general guide: W3School SQL FULL OUTER JOIN Keyword

CodePudding user response:

Try writing:

select * from DB1.schemaA.table1 as t1 full outer join DB2.schemaA.table1 as t2 on t1.ID = t2.ID;

  • Related