0

i am using mysql database. in table i am saving files name with extension. my files extension is .flv but i want to change file extension from .flv to .mp4. is there any way to achive this in mysql workbench. Thanks

Muhammad Ali Hassan
  • 960
  • 2
  • 12
  • 29
  • possible duplicate of [MySQL string replace](http://stackoverflow.com/questions/5956993/mysql-string-replace) – Tony Hopkinson Apr 21 '14 at 15:27
  • there is hundreds of records there. and i want to change all. – Muhammad Ali Hassan Apr 21 '14 at 15:30
  • That's what that answer does, in your case it would be something like update myTable replace .flv with .mp4 where file name like '%.flv'. How many it does depends on how restrictive the where clause is, nothmng to do with replace. – Tony Hopkinson Apr 21 '14 at 15:35

1 Answers1

0

Try this query

update tablename set colname = replace(colname,'.flv','.mp4');
Ronak Shah
  • 1,539
  • 2
  • 13
  • 20