IN or OR

  • behera.prasanta

    Mr or Mrs. 500

    Points: 521

    Comments posted to this topic are about the item IN or OR

  • webrunner

    One Orange Chip

    Points: 29865

    Thanks for the question. However, something about the list of radio button options made me think the only option worth picking was that the queries give the same result, which happened to be correct.

    Maybe checkboxes would have made it harder?

    Just mt two cents. Thanks again.

    - webrunner

    -------------------
    A SQL query walks into a bar and sees two tables. He walks up to them and says Can I join you?
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Hany Helmy

    SSChampion

    Points: 13321

    Eazy.

  • SQLRNNR

    SSC Guru

    Points: 281210

    I appreciate the question. I seldom, if ever, think to perform the query in the second fashion.

    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

  • DrKiller

    Right there with Babe

    Points: 780

    SQLRNNR (11/2/2014)


    I appreciate the question. I seldom, if ever, think to perform the query in the second fashion.

    +1, didn't really know its possible (well just never thought of it)

    Are there any performance concerns of the second query though?

  • SQLRNNR

    SSC Guru

    Points: 281210

    DrKiller (11/2/2014)


    SQLRNNR (11/2/2014)


    I appreciate the question. I seldom, if ever, think to perform the query in the second fashion.

    +1, didn't really know its possible (well just never thought of it)

    Are there any performance concerns of the second query though?

    They both produce the same execution plan.

    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

  • This was removed by the editor as SPAM

  • uravindarreddy

    Ten Centuries

    Points: 1385

    +1.

    Really a nice question.

  • Victor Kirkpatrick

    Hall of Fame

    Points: 3672

    Excellent question. Never really thought about using option 2 before now.

  • SqlMel

    SSCrazy

    Points: 2891

    Good question, Thanks.

    ---------------
    Mel. 😎

  • behera.prasanta

    Mr or Mrs. 500

    Points: 521

    Both Statements have same performance and execution plan

  • cgumprich

    Right there with Babe

    Points: 798

    I learned something, so that makes it a good question, but to echo other concerns -- because of the radio buttons there was only one possible answer.

  • akljfhnlaflkj

    SSC Guru

    Points: 76202

    Seemed like both would return the same results. I just never use version two.

  • ronmoses@gmail.com

    SSCarpal Tunnel

    Points: 4480

    Yes, I agree this seemed fairly obvious, but the fact that there are three correct answers (the first three options are all true) and I'm only permitted to choose one of them led me to conclude it must be none of those, since it could not be all of those. Not a well-designed question at all.

    -----
    a haiku...

    NULL is not zero
    NULL is not an empty string
    NULL is the unknown

  • Aleksl-294755

    Hall of Fame

    Points: 3372

    Good question. Never thought about using the second option. I learned something. Thanks!

Viewing 15 posts - 1 through 15 (of 28 total)

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