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
  • 11,219
  • 11
  • 35
  • 42
Divyesh Jesadiya
  • 1,240
  • 3
  • 29
  • 54

1 Answers1

1

You can use REPLACE() function with UPDATE statement:

UPDATE yourtable SET `alias`=REPLACE(`alias`,'_','.');
vhu
  • 11,219
  • 11
  • 35
  • 42