Home > Mysql > Perintah replace pada mysql

Perintah replace pada mysql

Mysql mempunyai sintak REPLACE(nama_kolom, ‘saya di ganti’, ‘teks pengganti’);

bisa dengan query select ataupun update.

contoh Select: select REPLACE(nama_kolom, ‘saya di ganti’, ‘teks pengganti’) as nama_kolom_alias from nama_tabel where bla bla bla

contoh update: update nama_tabel set nama_kolom = REPLACE(nama_kolom, ‘saya di ganti’, ‘teks pengganti’) where bla bla bla

Okey… silahkan dicoba

Categories: Mysql Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: