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.


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.


WITH RecursiveExample as (select 5 as level 
union all
recursive select level-1 as level
from RecursiveExample
where level > 0 )
select * from RecursiveExample
Was this article helpful?
0 out of 0 found this helpful



Please sign in to leave a comment.