How to select multiple columns from first table while using EXCEPT on two tables

  • How to select multiple columns from first table while using EXCEPT on two tables

    Like Select Column1, Column2 from table1 except select Column1 from table2

    Thanks In Advance

  • Found it ! Instead of using Except I am using NOT EXISTS

  • EXCEPT requires the same number of columns from both tables.

    remember it's comparing row to row based ont he columns you select, so you need to either remove Column 2 from the first select or add it to the second;

    Select Column1, Column2 from table1

    except

    select Column1, Column2 from table2

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

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

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