MySQL Update

MySQL update

UPDATE LANGUAGE SET language_code = lower(language_code)


MySQL update from data
UPDATE translation_country tc1
LEFT JOIN translation_country tc2 ON tc1.country_id = tc2.country_id
SET tc1.tcountry_order = tc2.tcountry_order
WHERE tc1.language_id = 10 AND tc2.language_id = 1


MySql Update doesnt always update
MySql doesnt update if there is no change to the data this can be a problem if you are expecting a timestamp column to change

mysql> select * from customer where id = 45;
mysql> update customer set name=char(67) where id = 45;

mysql> select * from customer where id = 45;
mysql> update customer set name=char(67) where id = 45;


for second and future times you'll see row matched BUT no actual update !

Query OK, 0 rows affected (0.11 sec)
Rows matched: 1  Changed: 0  Warnings: 0



REFERRERS
MySqlDataManipulation
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki