SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,079
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)

    Query 3 DBs depending on column name

    I have a large table of records that need joined againts three other databases depending on database_name. example data:

    Code:
    pk   db_name  data
    1    db1     whatever else
    2    db1     whatever else
    3    db3     whatever else
    7    db2     whatever else
    8    db2     whatever else
    10   db1    whatever else
    those primary keys may only exist on that one db that it needs retreived from, or it may even be taken by another file that doesnt match with my data, Im not really sure. So either way i need to make sure my join is only with the proper db.

    I'll also be doing this daily, multiple times so I'd like to skip the step of making 3 seperate tables for the query (though this could maybe be done in the query?)

    In any case any suggestions here would be appreciated.

    Edit: I'd like to stay away from any make / drop table queries if possible.

  2. #2
    SitePoint Wizard
    Join Date
    Jul 2003
    Location
    Kent
    Posts
    1,921
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Three separate databases? Or three separate tables? You sure it's not the latter?

  3. #3
    Always A Novice bronze trophy
    K. Wolfe's Avatar
    Join Date
    Nov 2003
    Location
    Columbus, OH
    Posts
    2,079
    Mentioned
    53 Post(s)
    Tagged
    0 Thread(s)
    Sorry. Technically it is three seperate databases but our front end we access it through does make it accessible through different tables somehow.


Bookmarks

Posting Permissions

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