Home Forums SQL Server 2005 T-SQL (SS2K5) Is this a "gaps and islands" problem? Finding gaps in overlapping times. RE: Is this a "gaps and islands" problem? Finding gaps in overlapping times.

  • OK. So I'm trying to understand table value constructors and cross apply. If I do this (on a SQL 2008 machine):

    SELECT *

    FROM (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) a (n)

    CROSS JOIN (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) b (n)

    CROSS JOIN (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) c (n)

    CROSS JOIN (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) d (n)

    CROSS JOIN (VALUES (0),(0),(0),(0),(0),(0),(0),(0),(0),(0)) e (n)

    ...I get 100,000 rows and 5 columns. All the columns are called n and all the values are zero. What does this do? Why do I need 5 identical columns?

    ...One of the symptoms of an approaching nervous breakdown is the belief that ones work is terribly important.... Bertrand Russell