cancel
Showing results for 
Search instead for 
Did you mean: 

Retrieve hierarchical tree in Hana query

mario_galeano
Participant
0 Kudos

How can I replicate Oracle's connect by level function in Hana?

SELECT t.cantidad+rownum VALOR, CASE WHEN t.cantidad+rownum = 0 THEN 'Contado' WHEN t.cantidad+rownum = 1 THEN t.cantidad+rownum||' Cuota' ELSE t.cantidad+rownum||' Cuotas' END DESCRIPCION FROM (SELECT -1 cantidad FROM DUAL WHERE -1 IS NOT NULL  )t connect by level <= 121;

Accepted Solutions (0)

Answers (1)

Answers (1)

simon25
Advisor
Advisor
0 Kudos

Hi Mario,

I don't believe HANA has the 'connect by' functionality lik eother DB sources.

Can you review the below and see if they answer your query ?

2073410 - Hierarchical Queries in ORACLE and SAP HANA

https://blogs.sap.com/2013/04/17/flattening-the-hierarchy-using-sql-code/

Hierarchy Functions

Kind Regards

Simon