Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

Hierarchy - Sap Hana. How to?

$
0
0

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.


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>