0

I have following record in MySQL database:

id         name                         alias
1          vijay hazare                 vijay_hazare
2          ravi shastri                 ravi_shastri
3          rahul dravid                 rahul_dravid

I want them like this.

id         name                         alias
1          vijay hazare                 vijay.hazare
2          ravi shastri                 ravi.shastri
3          rahul dravid                 rahul.dravid

I have 6000 records in my database and I want to change _ to .(dot) in "alias" field to all table.

vhu
  • 12,244
  • 11
  • 38
  • 48
Divyesh Jesadiya
  • 1,105
  • 4
  • 30
  • 68

1 Answers1

1

You can use REPLACE() function with UPDATE statement:

UPDATE yourtable SET `alias`=REPLACE(`alias`,'_','.');
vhu
  • 12,244
  • 11
  • 38
  • 48