Skip to Main Content
  • Questions
  • In SQL Developer Query Builder can I construct a query involving 2 tables from separate schemas in the same database

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Stephen.

Asked: February 02, 2017 - 9:19 pm UTC

Last updated: February 03, 2017 - 12:18 am UTC

Version: 11

Viewed 1000+ times

You Asked

In Query Builder, I would like to execute something akin to the example. I already have two connections configured to the same database which differ only by the username/schema.

SELECT a1.foo, b1.bar
FROM schema_a.table1 a1
JOIN schema_b.table1 b1 ON a1.id = b1.id
WHERE a1.foo > 300



and Connor said...

Yes you can (as long as the user you are connected as has privs on the objects concerned). You just drag and drop them into the same query builder panel.

Some demos to help you along the way here

Video demo

http://www.thatjeffsmith.com/archive/2014/03/oracle-sql-developer-query-builder-video-demonstration/

And how to use it to build subqueries if you want

http://www.thatjeffsmith.com/archive/2016/11/how-to-build-a-subquery-with-sql-developers-query-builder/



Is this answer out of date? If it is, please let us know via a Comment