Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2004
    Posts
    8

    Unanswered: Join tables in diferents databases

    How can I join two tables in diferent databases? If it's not possible, how can I join two tables in diferent schemas?

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1
    1) Different databases:

    select ...
    from tab1@db1 t1, tab2@db2 t2
    where t1.x = t2.x;

    2) Different schemas:

    select ...
    from schema1.tab1 t1, schema2.tab2
    where t1.x = t2.x;

    3) Both at once:

    select ...
    from schema1.tab1@db1 t1, schema2.tab2@db2
    where t1.x = t2.x;

  3. #3
    Join Date
    Feb 2004
    Posts
    8
    Quote Originally Posted by andrewst
    1) Different databases:

    select ...
    from tab1@db1 t1, tab2@db2 t2
    where t1.x = t2.x;

    2) Different schemas:

    select ...
    from schema1.tab1 t1, schema2.tab2
    where t1.x = t2.x;

    3) Both at once:

    select ...
    from schema1.tab1@db1 t1, schema2.tab2@db2
    where t1.x = t2.x;
    Thanks andrewst!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •