Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to copy userId = 10 yesterday's record and duplicate it but with today's date, that should be stored in "dateM" column. Overall this whole event is not working. I have tried many other ways but no use.

What I have tried:

SQL
 CREATE EVENT test_user_10
  ON SCHEDULE
       EVERY 1 DAY
    STARTS '2016-11-28 19:20:00' ON COMPLETION PRESERVE ENABLE 
  DO

INSERT INTO measurement 

(userId,height,age,weightEnter,weight,chestSkin) 

SELECT 
(userId,height,age,weightEnter,weight,chestSkin)

FROM measurement WHERE userId = 10 AND date(dateM)=(CURDATE()-1);
Posted
Updated 28-Nov-16 6:40am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900