I have a string, say:
Product Description [White]
I want to extract anything inside the brackets (in this case White
) from that str
i think you want to update some value like grade pay from pay scale or any thing just use following query
UPDATE master.pay_scale SET grade_pay= Case When description LIKE '%(%)%' Then (select substring(description from '((.+))')) else description End::numeric
(.)
only matches a single character, but you want to match multiple characters in there.
So you need (.+)
substring('Product Description [White]' from '\[(.+)\]')