sql to get most recent records
How would I write the query for mySQL to get all the records in a table that
were written in tha last 10 minutes?
I have a timestamp field (fldTime) that automatically inserts the curent
time when the record is inserted, but I'm unsure how to write a query that
would only get records from the last 10 miniutes.
Any help would be appreciated.
Dave
Re: sql to get most recent records
Dave wrote:
> I have a timestamp field (fldTime) that automatically inserts the curent
> time when the record is inserted, but I'm unsure how to write a query that
> would only get records from the last 10 miniutes.
SELECT ...
FROM tablename
WHERE fldTime > NOW() - INTERVAL 10 MINUTE
Regards,
Bill K.
Re: sql to get most recent records
That's great, thanks Bill
"Bill Karwin" <bill [at] karwin.com> wrote in message
news:eathrb11kj5 [at] enews2.newsguy.com...
> Dave wrote:
>> I have a timestamp field (fldTime) that automatically inserts the curent
>> time when the record is inserted, but I'm unsure how to write a query
>> that would only get records from the last 10 miniutes.
>
> SELECT ...
> FROM tablename
> WHERE fldTime > NOW() - INTERVAL 10 MINUTE
>
> Regards,
> Bill K.