Postgresql, get string after multiple ':' character -


i have following column entries

01:02:02:02 02:01:100:300 128:02:12:02 

input

i need way choose parts want display

01:02:02 02:01:100 128:02:12 

output or

01:02 02:01 128:02 

i tried suggested solutions in similar questions without success like

select substring(column_name, '[^:]*$') table_name; 

how work?

to first 3 parts, can use

select substring(column_name '^(([^:]*:){2}[^:]*)') table_name; 

for first 2 parts, omit {2}. first 4 parts, make {3}.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -