Skip to content

Commit

Permalink
Added test for query on hierarchical CTE tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
glecchi committed Nov 20, 2024
1 parent d35a20d commit d676af9
Showing 1 changed file with 19 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
WITH _t0 AS
(
SELECT
_t0.*
FROM [dbo].[Categories] AS _t0
),
_t1 AS
(
SELECT
_t1.*
FROM [dbo].[Products] AS _t1
INNER JOIN _t0 ON (_t1.[CategoryID] = _t0.[CategoryID])
WHERE (_t1.[SupplierID] IS NOT NULL)
)

SELECT
_t2.*
FROM [dbo].[Suppliers] AS _t2
INNER JOIN _t1 ON (_t2.[SupplierID] = _t1.[SupplierID])

0 comments on commit d676af9

Please sign in to comment.