cancel
Showing results for 
Search instead for 
Did you mean: 

Hana SQL compression of values

0 Kudos
140

Hi,

What kind of SQL operation has be applied to get from point A to point B :

point A

261/261/261/261/262/262

point B

261/262

Thanks

View Entire Topic
fedaros
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi aleksandrskerauts,

Doubts about what you are asking, the "point" word moved my mind to some special hana spacial cabilitities rssss

Using regex you can achieve it on a string:

select REPLACE_REGEXPR('\b(\d+)\/(?=.*?\b\1\b)' IN '261/261/261/261/262/262') as x
from dummy;

Regards, Fernando Da Rós

0 Kudos

Thanks , it works perfectly

Can u please elaborate the logic below as I don't get it

fedaros
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi aleksandrskerauts,

Regular expressions is not new, to answer your request for explanation I don't need to think as there were already tools out there.

I googled one here check https://regexr.com/ put the expression, the string you want and if check only the regular expression dna highlight what will happen.

Inside netweaver system you have DEMO_REGEX program that test and run, but it doesn't explain like this one found site.

RegEx is powerfull.

Regards, Fernando Da Rós