Results 1 to 3 of 3

Thread: Select query from two databases

  1. #1
    Join Date
    Aug 2009

    Select query from two databases

    I can't figure this out.
    I have two tables in two different dbs, they are not alike at all but do have one column that is the same.

    Table A contains all users in the company.
    Table B contains users that have access to an application.

    I want to get the list of users from Table A that do not exist in Table B.

    Should I be using Union or Joins?
    Examples please.

    Thanks in advance.

  2. #2
    Join Date
    Aug 2004
    I'm thinking maybe a nested query?
    SELECT * FROM database_1.table_a WHERE user NOT IN (
       SELECT user FROM database_2.table_b
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  3. #3
    Join Date
    Aug 2009
    thanks nogdog, that did it.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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