Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. UPDATE d.timestamp_manipulation_experiments
  2. SET `timestamp` = `timestamp` + '0001-01-01 01:01:01' WHERE id = 2;
  3.  
  4. SELECT * FROM d.timestamp_manipulation_experiments;
  5.  
  6. -- add 2 Minutes and 1 Second to the current timestamp and look at the result
  7. UPDATE d.timestamp_manipulation_experiments
  8. SET `timestamp` = DATE_ADD(`timestamp`, INTERVAL '2:1' MINUTE_SECOND) WHERE id = 2;
  9. SELECT * FROM d.timestamp_manipulation_experiments WHERE id = 2;
  10.  
  11. -- add 1 week to the current timestamp and look at the result
  12. UPDATE d.timestamp_manipulation_experiments
  13. SET `timestamp` = TIMESTAMPADD(WEEK,1,`timestamp`) WHERE id = 2;
  14. SELECT * FROM d.timestamp_manipulation_experiments WHERE id = 2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement