MySQL prefix, suffix for a field

During development, you may encounter situations prefix or suffix. For example, add the path to the video, if you manually add certainly slower, but less in line with the characteristics of programmers, we should allow the program to run manually will not increase.

使用UPDATE sql 语句:update vod set path=concat('hello',path,'world') where id>0;

vod is the table name, path is the name of the field you want to change, hello is to add a prefix, world is to add the suffix.

If you want to add the prefix will be written .... path = concat ( 'hello', path) .... the same way as suffixes.

Guess you like

Origin www.cnblogs.com/dlmg/p/11403507.html