Replace space (" ") with no space ("") in one column

Try this:

To show without space:

select trim(kota) from yourtable

To change your data:

update yourtable set kota = trim(kota);

TRIM function is different to REPLACE. REPLACE substitutes all occurrences of a string; TRIM removes only the spaces at the start and end of your string.

If you want to remove only from the start you can use LTRIM instead. For the end only you can use RTRIM.


Run New Query in mysql

select REPLACE(kota,' ','') from table-name

this will show the result how it looks like after trimming spaces from the column and to update

update table-name set kota = REPLACE(kota,' ','')

Save.