SELECT D.n AS theday, S.n AS shiftno FROM dbo.Nums AS D CROSS JOIN dbo.Nums AS S WHERE D.n <= 7 AND S.N <= 3 ORDER BY theday, shiftno;
- 4. Combining Sets
- from Training Kit (Exam 70-461): Querying Microsoft® SQL Server® 2012
- Publisher: Microsoft Press
- Released: December 2012
Using a single table/column of integers to mark 1-7 as the day and 1-3 as the shift to create every possible combination of day and shift.
Share this highlighthttp://www.safaribooksonline.com/a/training-kit-exam/59524/