Ok, I need something like this:
datediff(second, date_one, date_two) < 1
dates are stored in a column ‘datetime’ type
UPDATE
I want to find dates which differ in less than several (say, 10) seconds
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Second is the smallest unit in DATETIME fields. If you want to check that the difference is less than 1 second, that means that the two dates must be the same, in which case you can simply use the equivalency operator.
To check the time difference using bigger units you can use TIMEDIFF with TIME_TO_SEC. For example to check if two datetimes are between 10 seconds of each other