Sql updating multiple tables at once
4 | 25 from 04 08 2003 / 26 from 05 03 2003 /
I had a problem - a had to update a column "rate" but if the existince or new value is greater then 5 this "5" will be finally value in field.
So, I do it in one "magick" query ;)Here an example:"3" is a some value, from form or somethingupdate item set rate = case when round((rate 3)/2) You sometimes run into the problem that you want to replace a substring occuring in a column with a different string, without touching the rest of the string.
The solution is surprisingly simple, thanks to My SQL: UPDATE xoops_bb_posts_text SET post_text=( REPLACE (post_text, 'morphix.sourceforge.net', ' the string function REPLACE, all items in the post_text column with 'morphix.sourceforge.net' get this substring replaced by '
A very tedious task to update over 70 tables with ssn columns one by one.
Does anyone have an idea how to do this efficiently ?