Results 1 to 3 of 3

Hybrid View

  1. #1
    Join Date
    May 2001
    Posts
    81

    Joining tables from 2 databases in MySQL

    Anyone know if it's possible to join 2 tables from 2 different databases in MySQL?

  2. #2
    Join Date
    Jan 2002
    Location
    Melbourne, AU
    Posts
    740
    This may be of some help.


    Lats...

  3. #3
    Join Date
    Jun 2001
    Location
    Earth
    Posts
    1,259
    As long as the user has permissions in both databases I belive it's quite easy:

    select a.col_1, b.col_2
    from db1.table_1 a,
    db2.table_2 b
    where a.col_3 = b.col_3

    Just fully qualify the table name with the db name.

    Frank
    Umbra Hosting
    cPanel | Softaculous | CloudLinux | R1Soft | Ksplice
    Web Hosting, Reseller Hosting, VPS, Dedicated Servers, Colocation
    UmbraHosting.com

Posting Permissions

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