Question

I have a table like this:

ID | Propinsi | Kota |
_________________________
 1 | Aceh     | Denpasar
 2 | Aceh     | Banda Aceh
 3 | Sumatera | Asahan

This table has many rows. The problem is I want to replace the space before the text in column Kota for all rows like this:

ID | Propinsi | Kota |
_________________________
 1 | Aceh     |Denpasar
 2 | Aceh     |Banda Aceh
 3 | Sumatera |Asahan

I searched Google, the function replace in MySQL only affects one row:

SELECT REPLACE(string_column, 'search', 'replace') as Kota

Can someone fix my problem?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top