Click here to get back home

sql to get most recent records

 HomeNewsGroups | Search | About
 mailing.database.mysql    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
sql to get most recent records Dave 08-03-2006
Get Chitika Premium
Posted by Dave on August 3, 2006, 11:44 am
Please log in for more thread options
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



Posted by Bill Karwin on August 3, 2006, 3:12 pm
Please log in for more thread options
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.

Posted by Dave on August 3, 2006, 3:54 pm
Please log in for more thread options
That's great, thanks Bill

> 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.



Similar ThreadsPosted
Returning most recent records? January 15, 2006, 4:18 pm
All Records From Table A - All Records From Table B - Join Alike Records October 3, 2006, 11:24 am
sort asc w/ most recent August 20, 2006, 5:01 am
Distinct, Most Recent Sort June 4, 2005, 12:16 am
Trying to retrieve most recent record per date October 26, 2006, 4:04 pm
Trouble with query to get most recent version of an element March 22, 2006, 8:38 am
How do I get rid of duplicate records? March 2, 2006, 2:47 pm
setting value for all records November 15, 2006, 8:07 am
getting unique records November 23, 2006, 9:58 am
Find records without matches July 12, 2005, 6:25 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap