Skip to content

Instantly share code, notes, and snippets.

@zerobugs-oficial
Created June 18, 2020 15:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerobugs-oficial/73818d3cf16a14d2bf5e7f949cfdc7e4 to your computer and use it in GitHub Desktop.
Save zerobugs-oficial/73818d3cf16a14d2bf5e7f949cfdc7e4 to your computer and use it in GitHub Desktop.
MySQL: Somar número de dias, meses ou anos a uma data - 2
UPDATE tabela
SET coluna_data = ADDDATE(coluna_data, INTERVAL 12 YEAR)
WHERE id = 15
SELECT ADDDATE(coluna_data, INTERVAL 12 DAY)
FROM tabela
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment