Created
January 20, 2014 08:55
-
-
Save csalgueiro/8517003 to your computer and use it in GitHub Desktop.
Filtrar en base a fechas utilizando intervalos desde la fecha actual.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Obtener registros de la tabla con fecha superior a hace tres meses | |
SELECT * FROM tabla WHERE fecha >= DATE_ADD(NOW(),INTERVAL -3 MONTH) | |
// De otro modo: | |
SELECT * FROM tabla WHERE fecha >= (NOW() + INTERVAL -3 MONTH) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment