replace string on sql

PHOTO EMBED

Fri Apr 08 2022 03:32:28 GMT+0000 (Coordinated Universal Time)

Saved by @Bambibo9799

select *, char_length(replaced) 
from(
select *, lower(left(trim(country),9)) as replaced
from cc_csv as cc 
)t1

lower
upper
left
right
substring
trim

upper < left < trim < replace

REPLACE(REPLACE(region,'&','and'),'.','') AS character_swap_and_remove
REPLACE(TRIM(event),'-','') AS event_fixed, 

select *, trim(replace(replace(distance, 'km',''),'null','0')) as distancefixed
,left(replace(duration,'null','0'),2) as durationfixed
,replace(pickup_time,'null','') as pickuptimefixed
,coalesce(replace(cancellation,'null',''),'') as cancellationfixed
from runner_orders as ro 
content_copyCOPY