Postgresql: Remove last char in text-field if the column ends with minus sign
Postgresql: Remove last char in text-field if the column ends with minus sign
От:
Sarang Dave <saranghdave@gmail.com>
Дата:
Hello sir,
I want to remove the last char in a column if it ends with the minus sign. How could I do this in postgresql?
For example:
sdfs-dfg4t-etze45z5z- => sdfs-dfg4t-etze45z5z
gsdhfhsfh-rgertggh => stay untouched
Is there an easy syntax I can use?
Thanking You.
With Regards,
Sarang Dave
Re: Postgresql: Remove last char in text-field if the column ends with minus sign
От:
Steve Crawford <scrawford@pinpointresearch.com>
Дата:
On 12/16/2010 06:52 AM, Sarang Dave wrote:
Cheers,
Steve
regexp_replace(your_field, '-+$', '');Hello sir,
I want to remove the last char in a column if it ends with the minus sign. How could I do this in postgresql?
Cheers,
Steve