Kaveh
Kaveh

Reputation: 2650

How can i change files prefix in MySQL from .mp4 to .mp3

In a table in MySQL I have 10000 records and in one of the fields I have 10000 file names with .mp4 prefix. How can I can change/replace all .mp4 to .mp3 using MySQL query?

Upvotes: 1

Views: 98

Answers (2)

Virendra
Virendra

Reputation: 2553

You can use find replace in mysql. To do this you can use the following query

UPDATE tbtracks SET trackname = REPLACE(trackname,'.mp4','.mp3');

This query will find and replace all occurrences of .mp4 to .mp3 in the trackname column.

For more details check out my blog post on How to find and replace data in MySQL

Upvotes: 0

eLemEnt
eLemEnt

Reputation: 1801

You can use following mysql query to replace it with mp3

update tbtracks set trackname = Replace(trackname,'mp4','mp3');

Upvotes: 3

Related Questions