IN or OR

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

  • 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 asks, "Can I join you?"
    Ref.: http://tkyte.blogspot.com/2009/02/sql-joke.html

  • Eazy.

    Thanks & Best Regards,
    Hany Helmy
    SQL Server Database Consultant

  • 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

  • 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?

  • 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

  • +1.

    Really a nice question.

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

  • Good question, Thanks.

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

  • Both Statements have same performance and execution plan

  • 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.

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

  • 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

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

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

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