Created
November 27, 2018 13:23
-
-
Save MohamedLamineAllal/8eeb6115bd52ba97f9bb4e8430a94d7b 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