Once you can group your rules into something reasonable you can use syntax
like this one:
UPDATE city
SET cityClass = CASE
WHEN population < 1000
THEN 1
WHEN population < 500000
THEN 2
WHEN population > 1000000
THEN 4
ELSE 3
END
WHERE cityId between 1 and 200;
But when each row got a separate logic - just execute multiple queries.
Reegards,
m
-----Original Message-----
From: MuraliKrishna [mailto:[email protected]]
Sent: Friday, February 05, 2010 10:55 AM
To: 'misiaQ'
Subject: RE: how to update entire column with different values
Whats the set data type I don't know... what I have to do is.. I have to
update the years... for a entire column... like
Update table1
Set year= if(id=1, then 2005)
If(id=2, then 2003)
.... like this...
If any body know how to make it.. please help me
----------------------------------------------------------------------
Kup wlasne mieszkanie za 72 tys. zl.
Sprawdz najlepsze oferty >>> http://link.interia.pl/f25a8
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[email protected]