I have a table that contains two datetime columns, and I need to determine
the time between the two dates. So, what I've been doing is just
subtracting what I know is the later date from the earlier date. But that's
obviously not the way to do it as my results don't relate to anything.
Here's
You could use the UNIX_TIMESTAMP() function to easily determine
the difference in seconds between the two dates.
select UNIX_TIMESTAMP( Datetime_A ) ...
and the do the time_a - time_b thing. there might be a simple query that
will work as well, but I don't know the mysql date queries that good