Trim trailing spaces with PostgreSQL

后端 未结 4 1712
野趣味
野趣味 2020-12-04 13:30

I have a column eventDate which contains trailing spaces. I am trying to remove them with the PostgreSQL function TRIM(). More specifically, I am r

4条回答
  •  春和景丽
    2020-12-04 13:48

    It should work the way you're handling it, but it's hard to say without knowing the specific string.

    If you're only trimming leading spaces, you might want to use the more concise form:

    SELECT RTRIM(eventDate) 
    FROM EventDates;
    

    This is a little test to show you that it works. Tell us if it works out!

提交回复
热议问题