Search Postgresql Archives

Re: Removing terminal period from varchar string in table column

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/15/25 11:30, Rich Shepard wrote:

I want to remove the terminal period '.' from the varchar strings in the
'company_name' column in all rows with that period in the companies table.

I've looked at trim(), translate(), "substr(company_name 1,
length(compan_name) - 1)", and a couple of other functions and am unsure how
best to do this without corrupting the database table.

Advice needed.

TIA,

Rich



How about

test:

    select company_name, replace(company_name,'.','') from companies;

update:

    update companies set company_name = replace(company_name,'.','') where company_name like '%.';

?

Jeff


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux