SELECT Statement and Exclude List

  • I have a simple Stored Proc for a web app that does a SELECT off a single table.

    SELECT Make, Model, Color

    FROM tblCars

    WHERE Make = @make

    Sample Results:

    Honda, Prelude, Red

    Honda, Prelude, Black

    Honda, Prius, Blue

    Honda, Prius, White

    Honda, Prius, Black

    I need to exclude certain Models and Colors from the output. NOT IN will not work since I need to base exclusion on two columns. However, that's basically what I need to do. My exclusion list is a static table of just Model and Color columns).

    I feel this is a simple task, but I want to do it the most efficient way without #temp tables.

    Thank you much!

  • Nevermind, I found the simple resolution.

  • Thanks for posting back.

    Mind sharing what your solution was? Any who come after with a similar question might benefit.

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

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

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