Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Inequality join in Analytic view of SAP HANA

$
0
0

I tried using SQL Server syntax for "between join".  I was hoping that "between join" was implemented in HANA, even though I could not find it in the documentation.  It looks like it works.

 

I started with small sample table of contracts and a one-column table of calendar days.  I was able to join them in SQL. This gave me the number of days covered by contract, even if contracts overlap.

 

SELECT "SERIAL_NUMBER", COUNT(DISTINCT cal."CalendarDays")CT

FROM  "SCHEMANAME"."CONTRACT_TEST" contr

JOIN "SCHEMANAME"."CALENDAR_DAYS" cal

    ON cal."CalendarDays" BETWEEN contr."ContractStart" AND contr."ContractEnd"

GROUP BY "SERIAL_NUMBER"

 

This won't work as an analytic view, but I think it would be OK as a SQLScript calculation view.


Viewing all articles
Browse latest Browse all 9129

Trending Articles



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