Remove the field values before and after Oracle database space

Bell found oracle field contains spaces, spaces may be before, it could be after the space, as is the historical data, require special handling. But in the middle of the space may be a name containing special personnel, this situation can not handle. So we can only spaces before and need to be addressed. Use the following sql, can be solved.

update t_pwm_bind
   set customer_nm = trim(customer_nm),
       crd_no      = trim(crd_no),
       certif_id   = trim(certif_id),
       phone_no       = trim(phone_no)
 where customer_nm like '% '
    or customer_nm like ' %'

 

Guess you like

Origin www.cnblogs.com/yuanchaoyong/p/11804302.html