Skip to content
Advertisement

Regex in SQL query – REMOVE AFTER

GOAL

I want to remove with regex in SQL query everything after the colon, can someone help me to mount this query? I made several attempts but without success …

Normal query

enter image description here

Remove with Regex

enter image description here

DESIRED RESULT

ATTEMPT

Advertisement

Answer

You might find it simpler to use REGEXP_EXTRACT

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.5.0/com.ibm.db2.luw.sql.ref.doc/doc/r0061492.html

e.g.

which will return

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement