SELECT TRIM( -- remove sourrounding spaces
REPLACE( -- remove remaining double spaces
REPLACE(
REPLACE(
REPLACE(
-- ...
REPLACE(
REPLACE(
REPLACE(
REPLACE( CONCAT( ' ' , 'W A Mozart', ' '), ' ', ' '),
' A ', ' A.'),
' B ', ' B.'),
' C ', ' C.'),
-- ...
' X ', ' X.'),
' Y ', ' Y.'),
' Z ', ' Z.'),
' ', ' ') -- remove remaining double spaces
);
Ahem, that is a pragmatic solution ... Plus, you can easily specify the letters to be regarded as an abbreviation or not.
The sourrounding space padding helps to find single letters at the beginning and the end of the string.
The initial double space padding is required to make the functions inner workings match shared spaces between two letters.
Remaining helper spaces are removed by the two outermost function calls of TRIM and REPLACE.
Remember, the matching is case-sensitive.