Skip to content

Instantly share code, notes, and snippets.

@lasekmiroslaw
Created July 24, 2018 19:55
Show Gist options
  • Save lasekmiroslaw/41cecd2f93b4daf28073b9a9ece0308e to your computer and use it in GitHub Desktop.
Save lasekmiroslaw/41cecd2f93b4daf28073b9a9ece0308e to your computer and use it in GitHub Desktop.
mysql course
create column auto update timestamp:
CREATE TABLE comments2 (
content VARCHAR(100),
changed_at TIMESTAMP DEFAULT NOW() ON UPDATE CURRENT_TIMESTAMP
);
Date Math:
SELECT birthdt, birthdt + INTERVAL 15 MONTH + INTERVAL 10 HOUR FROM people;
Date Format
SELECT DATE_FORMAT(birthdt, '%m/%d/%Y at %h:%i') FROM people;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment