MySQL: update multiple value of a column in single query -


i have table named misc_jobs in there column named title in ii have multiple value data example : driver , engineer , doctor , teacher , joker etc.

i want change values driver, engneer , doctor should converted drv , eng , doc respectively.

how update in mysql in single query?

you can use case this:

update misc_jobs set title = case    when client='driver' 'drv'   when client='engineer' 'eng'   when client='doctor' 'doc' end; 

Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -