sql query

  • Hi,

    I need the sql query to pull data from 5 different tables.

    For example i have tables a,b,c,d,e

    I need to pull data from table that exsists in a,b,c and that are not in d,e

    Problem is that i have few millions records to load

    I would appreciate if someone could provide the sql to load the data

  • From your requirements, here's the SQL:

    SELECT A.Col1 ,

    b.Col1 ,

    C.Col1

    FROM A

    INNER JOIN B ON A.Col1 = B.Col1

    INNER JOIN C ON B.Col1 = C.Col1

    LEFT JOIN D ON A.Col1 = D.Col1

    LEFT JOIN E ON E.Col1 = E.Col1

    WHERE D.Col1 IS NULL

    AND E.Col1 IS NULL

    From your requirements, this is the clearer statement that you will get. If not, post the information you are really looking for, and don't forget, we don't see what you see on your screen..... 😉

    Cheers,

    J-F

  • Please take the time to read AND follow the instructions provided in the first article I reference below in my signature block regarding asking for help.

    Based solely on your original post, you aren't going to get much help.

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

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