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
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
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
ABS(TIME_TO_SEC(TIMEDIFF(datetime1, datetime2))) < 10