TARGIT InMemory supports the standard WITH statement. WITH Statements allow you to break more complicated SQL logic into more easily handled chunks. They are consumed by the next SELECT statement. They act like temporarily views that are used by the next SQL Select statement.
Example:with MyCustomTable as ( select * from orders )with MyCustomTable2 as ( select * from customers )select sum(1) from MyCustomTable inner join MyCustomTable2 on MyCustomTable.customerid = MyCustomTable2.customerid
Recursive WITH statements are supported using the RECURSIVE keyword before the recursive SELECT.
Example:
WITH RecursiveExample as (select 5 as level
union all
recursive select level-1 as level
from RecursiveExample
where level > 0 )
select * from RecursiveExample

  • No labels