Hi,
i have something like 40K rows and i must run update query like this:
UPDATE table1
SET column1='very long value 1...', column2='normal lenght value 1a'
WHERE pid ='123' column3='ccc';
column1 is TEXT
column2 is Varchar(150)
...and i want to use mysql query what is more server resource friendly.
I want to use something like that:
UPDATE table1
CASE pid
WHEN '123' THEN 'very long value 1...'
WHEN '124' THEN 'very long value 2...'
WHEN '543' THEN 'very long value 4...'
...
WHEN pid='34532' THEN 'very long value 5...'
ELSE column1
END,
column2=
CASE pid
WHEN '123' THEN 'normal lenght value 1a'
WHEN '124' THEN 'normal lenght value 2a'
WHEN '543' THEN 'normal lenght value 4a'
...
WHEN pid='34532' THEN 'normal lenght value 5a'
ELSE column2
END
WHERE pid IN ('123','124','543', ...,'34532') AND column3='ccc';
and my question is how many rows i can update in this way in one query?
Is there other server resource friendly method to update this 40K rows?
Regards, Pit