cancel
Showing results for 
Search instead for 
Did you mean: 

Hierarchy - Sap Hana. How to?

Former Member
0 Kudos

Hello!

My problem is that I don't really know how to do probably a simple thing with hierarchy. Let me explain first.

I have updated Sap Hana.

I have one big table(BigTable) in which I have fields as follow: BigTable(number, year, child).
Number is like id of a record for a year: (10,2014,8) and (10.2013,1). It can be really any number.
Year is a year. Can not be empty.
Child can be empty. The Child field is a pointer to a next record. Everything is working like a list of records
While(child.next)...; return child.

By going child->child in a loop we get to the last record. Which is very special

It is not possible to just simply jump to the last record from first. It must be done step by step.

We can have something like this: (10,2014,8) -> (8,2014,5) -> (5,2014, )

SELECT * FROM BigTable Where number = 8 AND year=2014;

Then we select with it next record:
SELECT * FROM BigTable Where number = child.fromLastSelect AND year = year.fromLastSelect;
With using hierarchy I would like to get to the one before last Child and return this: (10,2014,5).

The Code and examples I used are just a very simple and abstract example, but the problem is very real.
How can I do that? I tried to simply add hierarchy parent-child but its not really working for me, any advice? The most of tutorials I find are for outdated Hana.

With best regards,
Robert.

Message was edited by: Tom Flanagan

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

On other database systems this kind of hierarchy can be implemented via CONNECT BY, but this feature doesn't exist on SAP HANA. See SAP Note 2073410 for more information.