Quantcast
Channel: Bring text before the second special character in SQL - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Answer by Koushik Roy for Bring text before the second special character in SQL

$
0
0

One way is to use split_part() to split string based on : and then concat them again.Or second way is to use substring with regexp_instr() like below-

select split_part('ss pullover jaq:rwbwht:40',':',1) ||':' || split_part('ss pullover jaq:rwbwht:40',':',2) option1,  substring('ss pullover jaq:rwbwht:40',1,regexp_instr('ss pullover jaq:rwbwht:40',':',1,2)-1)  option2

Viewing all articles
Browse latest Browse all 3

Trending Articles



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