Run this from any database since it does not use any existing table!
2013-08-22
13,752 reads
Eli Leiba,
2012-02-20 (first published: 2011-12-31)
Run this from any database since it does not use any existing table!
Answer: SELECT (10*a.x + b.y) + 1 as z FROM (SELECT 0 as x union all SELECT 1 union all SELECT 2 union all SELECT 3 union all SELECT 4 union all SELECT 5 union all SELECT 6 union all SELECT 7 union all SELECT 8 union all SELECT 9 ) as a CROSS JOIN (SELECT 0 as y union all SELECT 1 union all SELECT 2 union all SELECT 3 union all SELECT 4 union all SELECT 5 union all SELECT 6 union all SELECT 7 union all SELECT 8 union all SELECT 9 ) as b ORDER BY 1
TSQL code that generates numbers (tally table) from 1 to N without using any tables
2012-03-01 (first published: 2012-02-21)
1,758 reads
This topic is nothing new, but well worth revisiting for those who have not used CROSS JOINS. You may have faced a problem where you need to compare historical records for a particular set of records to ensure that records have been saved in the correct order.
2009-01-28
4,596 reads
SSAS Maestro, SQL Server MVP and Business Intelligence Architect Bill Pearson introduces the MDX Head() function, which allows us to return, in order, a specified number of elements within a set.
2019-03-26 (first published: 2015-09-09)
3,829 reads
The first installment of this new stairway series will be discuss the CROSS JOIN operator. This stairway should help readers prepare for passing the Microsoft Certification exam 70-461: Querying Microsoft SQL Server 2012.
2022-02-09 (first published: 2014-12-17)
32,015 reads