Is my SQl query right?

  • Here is another approach not using JOIN.

    SELECTGUID,

    MIN(TableName) AS TableName

    FROM(

    SELECTGUID,

    'TableA' AS TableName

    FROMTableA

    UNION ALL

    SELECTGUID,

    'TableB'

    FROMTableB

    UNION ALL

    SELECTGUID,

    'TableC'

    FROMTableC

    ) AS d

    GROUP BYGUID

    HAVINGCOUNT(*) = 1


    N 56°04'39.16"
    E 12°55'05.25"

Viewing post 16 (of 15 total)

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