Quantcast
Channel: SCN : Discussion List - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6412

Defining a recursive view in SAP HANA

$
0
0

Hi All,

 

I have a problem defining a recursive view in HANA, in MS SQL for example I use the WITH statement to recursively iterate over the bill_of_materials view (see below), any idea how to do it in HANA?

 

WITH recursiveBOM
  
(assembly_id, assembly_name, parent_assembly) AS
(SELECT
parent.assembly_id,parent.assembly_name, parent.parent_assembly
FROM bill_of_materials parent
WHERE
parent.assembly_id=100
UNION ALL
SELECT child.assembly_id, child.assembly_name, child.parent_assembly
FROM recursiveBOM parent, bill_of_materials child
WHERE child.parent_assembly = parent.assembly_id)

SELECT assembly_id, parent_assembly, assembly_name
FROM recursiveBOM;

 

Thanks,

 

Tal


Viewing all articles
Browse latest Browse all 6412

Trending Articles