Re: Using Date Functions in Where Clause

2008-04-19 Thread Baron Schwartz
Hi, On Mon, Apr 14, 2008 at 1:54 PM, Jamie Madill <[EMAIL PROTECTED]> wrote: > Hello, > > Basically I want to know if this is a good query for indexing. > > I have the following query: > > select > count(1) as count > from > session > where > last >= DATE_SUB(NOW(), INTERVAL :from SECON

Using Date Functions in Where Clause

2008-04-14 Thread Jamie Madill
Hello, Basically I want to know if this is a good query for indexing. I have the following query: select count(1) as count from session where last >= DATE_SUB(NOW(), INTERVAL :from SECOND) Is it safe to assume that the expression calling the function DATE_SUB is evaluated just once to a f