Created
November 27, 2018 13:23
-
-
Save MohamedLamineAllal/238e6f6fc1264f54ea9e99e46fb7cda9 to your computer and use it in GitHub Desktop.
Using TIMESTAMPDIFF to get something that is a certain period old (with a where statement)
This file contains hidden or 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
SELECT *, | |
TIMESTAMPDIFF(DAY,created_at, CURRENT_TIMESTAMP()) -- just to check it's working | |
FROM RentCar.companies | |
where TIMESTAMPDIFF(DAY, created_at, CURRENT_TIMESTAMP()) < 5; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment