Data Retrival from two Tables

  • I had two Similar tables in two different Databases.

    Database 1 : Table  1

    Column1

    AB

    AC

    AD

    AF

    BC

    Database 2 : Table 2

    Column1

    AB

    AC

    AD

    These are the data in tables. Can you give me the select query which gives the results AF, BC. So I can show a error msg from from frontend app saying that AF, BC not exists in Database2 Table 1.

    Thanks in Advance

  • How 'bout ...

    select db1.column1 from database1.dbo.table1 db1 

    where db1.column1 not in (select db2.column1 from

    database2.dbo.table2 db2) 


    And then again, I might be wrong ...
    David Webb

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply