79601572

Date: 2025-05-01 08:29:21
Score: 1
Natty:
Report link

Perhaps, this is more generic for you:

TRIM(Both '_' FROM REGEXP_SUBSTR(Member_Target_Name), '_[^_]+_', 3, 1,'i') ) as ThirdElement

Lets say Member_Target_Name has this structure (values in square brackets are objects with values (including the brackets) :

x_[service]_[name]_[date_in_isostyle]_[type]

so a value sample would be:
s_myDB_MyApp_20250501_t

then the suggested code snippet pick up the third [name] element with text 'MyApp'.

Reasons:
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Peter Rosenberg