views:

18

answers:

1

Hi all,

Sorry if this has been asked but can't find anything. I have a table that has two epoch timestamps (one is start of a session, other is end of a session), I want to find if a variable is in between column x and column y. I've used between to see if a column is between two variables but can't really think of the syntax for the other way.

Cheers for any help

A: 

BETWEEN should work for timestamps. However, there are a handful of other date functions in MySQL that should be helpful. Check out UNIX_TIMESTAMP()

Jason McCreary
I probably should of just gone with my instincts. I always think I'm doing the wrong query with SQL
Rudiger