Search code examples
chardb2trim

How to TRIM OR TRUNCATE first character in DB2 column


I have column phone number with value and want to update the table column such that country code doesnt exist. 19083452345 14084456789 12023458900 18163456789

I tried to use LPAD, LTRIM but couldnt succeed.


Solution

  • Something like this using SUBSTR:

    update tablename set phone=substr(phone,2,length(phone)-1)