Query

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
sandy1028
Forum Commoner
Posts: 60
Joined: Thu Jul 26, 2007 3:56 am

Query

Post by sandy1028 »

Hi,

How to fetch all the data from current timestamp to previous 24hours.

select avg(`network`) from `tablename` where `fieldname` > now()-(3600*24) where name='$centre';


Here all the average of 1 day value I am able to fetch.

But I want to fetch the data for each 10 mins data which is in database
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Assuming you are using MySQL, http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html has all the information you need.
Post Reply