SOME

  • Comments posted to this topic are about the item SOME

  • Nice and Easy Question. Thanks 😀

  • Nice question, thanks.

    Never use ANY or SOME though 🙂

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Is there difference between SOME and ANY?

    Can someone explain?

  • Carlo Romagnano (3/21/2012)


    Is there difference between SOME and ANY?

    Can someone explain?

    There is no difference. http://msdn.microsoft.com/en-us/library/ms175064.aspx:

    SOME and ANY are equivalent.

  • Hi all,

    Interesting questions...also the following query:

    SELECT id

    FROM dbo.SalesDates s

    WHERE '2012/1/03' IN (SELECT saledate FROM SalesDates);

    is equivalent to the one given in the QotD. If you try for the example dates, it produces the same results as with ANY and SOME.

    (http://msdn.microsoft.com/en-us/library/ms177682.aspx)

    Igor Micev,My blog: www.igormicev.com

  • Hi all,

    Interesting questions...also the following query:

    SELECT id

    FROM dbo.SalesDates s

    WHERE '2012/1/03' IN (SELECT saledate FROM SalesDates);

    is equivalent to the one given in the QotD. If you try for the example dates, it produces the same results as with ANY and SOME.

    (http://msdn.microsoft.com/en-us/library/ms177682.aspx)

    Igor Micev,My blog: www.igormicev.com

  • Hi all,

    Interesting questions...also the following query:

    SELECT id

    FROM dbo.SalesDates s

    WHERE '2012/1/03' IN (SELECT saledate FROM SalesDates);

    is equivalent to the one given in the QotD. If you try for the example dates, it produces the same results as with ANY and SOME.

    (http://msdn.microsoft.com/en-us/library/ms177682.aspx)

    Igor Micev,My blog: www.igormicev.com

  • Good question. I have never used ANY or SOME in queries so have learned something once again.

  • The good thing in ANY or SOME is that you can make all kind of comparison not only equality or inequality.

  • Igor, congratulations on finding an easy way to pad your score! 🙂

    Steve, Thanks for the question.

    [font="Verdana"]Please don't go. The drones need you. They look up to you.[/font]
    Connect to me on LinkedIn

  • Nice question on a little known (and, frankly, barely useful) feature.

    Too bad it is hampered by the all too common mistake of depending on a time format. In some regions of the world, the test table has data for January 1st, February 1st, March 1st, and May 1st.

    #FeelingLikeBrokenRecord


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • Hugo Kornelis (3/21/2012)


    Nice question on a little known (and, frankly, barely useful) feature.

    Too bad it is hampered by the all too common mistake of depending on a time format. In some regions of the world, the test table has data for January 1st, February 1st, March 1st, and May 1st.

    #FeelingLikeBrokenRecord

    Hugo, According to my reading... this question doesn't care which date format (other than the answer that specifies Jan 3rd) it is using. In most, if not all, regions I would suppose that it would return all dates.

  • venoym (3/21/2012)


    Hugo Kornelis (3/21/2012)


    Nice question on a little known (and, frankly, barely useful) feature.

    Too bad it is hampered by the all too common mistake of depending on a time format. In some regions of the world, the test table has data for January 1st, February 1st, March 1st, and May 1st.

    #FeelingLikeBrokenRecord

    Hugo, According to my reading... this question doesn't care which date format (other than the answer that specifies Jan 3rd) it is using. In most, if not all, regions I would suppose that it would return all dates.

    True; for those who blindly copy and paste the code, it will not make a difference. To those who try to work out the answer in their head, it may make a difference if they see the "Jan 3" in the text of the question.

    Until I discovered the "incorrect" use of ANY and realised that this is what the question is about, I suspected that the question might be a trick question on date formats.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/

  • I had only looked at the ANY and SOME syntax once before and did not see a need for them. They seem to perform exactly like the IN statement unless I am missing something. Are there any instances where you could not perform the same logic using IN instead of ANY?

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

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