sql to get most recent records
am 03.08.2006 17:44:13 von dave
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
am 03.08.2006 21:12:54 von Bill Karwin
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
am 03.08.2006 21:54:53 von dave
That's great, thanks Bill
"Bill Karwin" wrote in message
news:eathrb11kj5@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.