I am trying to extract text between parenthesis from a column in postgres table. I am using following command. It is creating an additional blank column.
SELECT *, SUBSTRING (col2, '\[(.+)\]') FROM table
My table looks like this:
col1 col2
1 mut(MI_0118)
2 mut(MI_0119)
3 mut(MI_0120)
My desired output is:
col1 col2
1 MI_0118
2 MI_0119
3 MI_0120
How can I extract the text without creating an additional column.
Thanks