Antonio Arienzo: the blog

le mie esperienze IT

Rimuove spazi in eccesso da stringa SQL

fonte: http://stackoverflow.com/questions/2455750/replace-duplicate-spaces-with-a-single-space-in-t-sql SELECT REPLACE(REPLACE(REPLACE(‘some string with many spaces’ , ‘ ‘, ‘ ‘ + CHAR(7) + CHAR(7)), CHAR(7) + CHAR(7) + ‘ ‘, ”), ‘ ‘ + CHAR(7) + CHAR(7), ‘ ‘) AS NewStr –but it remove CHAR(7) + CHAR(7) from string How it works: Caution: Char/string used to replace spaces shouldn’t exist on begin or.. Read More