martes, 17 de julio de 2018

MYSQL - date and time functions


The date_format() function returns a date formatted according to the specified format.
select DATE_ADD( DATE_FORMAT( column,'%Y-%m-%d'), INTERVAL 2 DAY ) as last_updated
from table
where DATE_ADD( DATE_FORMAT( column,'%Y-%m-%d'), INTERVAL 1 DAY ) > '2018-07-17';

No hay comentarios:

Publicar un comentario