NOT BETWEEN

  • Nice n easy question to finish off the week. It's one of those, "No, it can't be this easy" kind of questions. Always looking for the QotD trick, but there was none...this time. (Insert evil laugh in background here, 'Muhahahaha' :laugh:) Great question.



    Everything is awesome!

  • thx for easy point.

    Thanks
    Vinay Kumar
    -----------------------------------------------------------------
    Keep Learning - Keep Growing !!!

  • I am a little surprised at the number of people that got this wrong. Maybe they read it wrong or looked at it too quickly. This is a straight back to basics logic question. While yes I agree with the others I was a little hesitant since it seemed too easy. Thanks for the nice light thinking after a long week.

  • Amazing that we are nearly 20 comments in and no one complained about the date format regional issue. Of course, that might be because the results would be the same in other regions....

  • dipmala.shende (3/30/2012)


    Hi..

    I got 1,6 as output..

    I run this query on SQL server and got the same output.

    Please let me know how we can get 2 as output.

    The request was number of rows

    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

  • Thanks for the easy question. I also was hesitant at first thinking it was too easy.

    Have a nice weekend, everyone.

    "El" Jerry.

    "El" Jerry.

    "A watt of Ottawa" - Gerardo Galvan

    To better understand your help request, please follow these best practices.[/url]

  • The only hesitation I had is that I use BETWEEN enough to know that it's inclusive at the lower and upper bounds, but don't use NOT BETWEEN very often so I thought maybe NOT BETWEEN would be exactly opposite and the lower/upper bounds would be exclusive so almost went with 4 rows returned, but went with gut and got it right.

  • Nice easy question, thanks.

    I spent a liitle time poring over it looking for some liitle snag that could make 2 the wrong answer; but then I remembered there was a very similar question recently (BETWEEN instead of NOT BETWEEN, also don with dates, even the same 6 dates in the table if I recall correctly) and that one had no little tricks, so decided that probably this one was OK too.

    Tom

  • Should have read the question better. Missed my point because I didn't read NOT BETWEEN.

    http://brittcluff.blogspot.com/

  • Nice & Easy one...

    Thanks

  • Good Question.....

  • I was expecting a trick to this one and was very relieved to get it right. Just proves that sometimes you have to go with your instinct.:-D

  • Nice and easy one to end the week on. Thanks Steve!

  • Thanks for the interesting and easy question.

  • OMG I confused that may ne

    NOT BETWEEN '2012/1/2' AND '2012/1/5'

    includes the dates used in not between clause also and i put 4 as answer...

    🙁 🙁 🙁

    Well, learn something new today

    _______________________________________________________________
    To get quick answer follow this link:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

Viewing 15 posts - 16 through 29 (of 29 total)

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