Or you can just use the REPLACE function:
with indata as (select 'John' as first_name, 'W' as middle_name, 'Smith ' as last_name from dual union select null as first_name, null as middle_name, 'Adams' as last_name from dual union select 'Tom' as first_name, null as middle_name, 'Jefferson' as last_name from dual) SELECT REPLACE(TRIM(indata.first_name || ' ' || indata.middle_name || ' ' || indata.last_name), ' ', ' ') FROM indata
(And thanks to @tbone for example data :-)
source share