Your technology certification is waiting. Enroll in Cloud Class ®
DROP TEMPORARY TABLE IF EXISTS tmp;
CREATE TEMPORARY TABLE tmp AS (
(@row_number:=@row_number + 1) idx, `Name`, `date`, sortcol
yourtable,(SELECT @row_number:=0) AS t
ORDER by sortcol
Update tmp set `date` = '2017-11-01' where idx <= 19;
Update tmp set `date` = '2017-11-02' where idx >= 20 and idx <= 40;
update yourtable a inner join tmp b
on a.`Name` = b.`Name`
set a.`date` = b.`date`;
select * from yourtable order by sortcol;
Open in new window
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.