Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- REPLACE(FIELD,'rn',' ')
- CREATE FUNCTION `multiTrim`(string varchar(1023),remove varchar(63)) RETURNS varchar(1023) CHARSET utf8
- BEGIN
- -- Remove trailing chars
- WHILE string<>"" and remove like concat('%',substring(string,-1),'%') do
- set string = substring(string,1,length(string)-1);
- END while;
- -- Remove leading chars
- while string<>"" and remove like concat('%',left(string,1),'%') do
- set string = substring(string,2);
- end while;
- RETURN string;
- END;
- select multiTrim(string,"rnt ");
- select trim(BOTH 'n' from [field_name]) as field
- update [table_name] set [field_name] = trim(BOTH 'n' from [field_name])
- UPDATE table SET field=REPLACE(field, field, TRIM(BOTH 'rn' FROM field))
- update events set eventuniqueid = substring(eventuniqueid, 1, 6) where length(eventuniqueid) = 7;
Add Comment
Please, Sign In to add comment