4
I have a field in a table in a Postgresql 8 database whose values are strings and have hyphens in some irregular positions.
I would like to replace the first occurrence of the hyphen in the string with a blank space, but I could not find anything appropriate in the documentation.
The functions I found as REPLACE() replace all occurrences and not just the first as I would wish.
Currently I am exporting the results . CSV and opening in MS Excel. With function =SUBSTITUIR(A1;"-";" ";1)
, I can do it. But I try to be more efficient and spend time doing it.
I appreciate the community’s help in advance.
Thanks for your reply. This option is not running on Postgresql version 8. The @Rovann Linhalis version has solved my problem. Thank you very much!
– Eduardo
This function is available for PG from 8.1.
– Marcos Regis