[SOLVED]combining records

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
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

[SOLVED]combining records

Post by ryuuka »

hello

i have a database wich get the load percentage of the various servers i have.
and this shows me how much work the servers have.
now for the problem: this database is updated every 5 min and the results are placed in a graph (using JPgraph)
but i want every point in the graph to be an update of the last half hour.
example:

this is the record set
Image

and this is the graph
Image


i want the graph to show the highest value for every half hour. without changing the database
(because i might want that info for something else). i think this could be done best with a new query.
btw sr0029 is a name usually filled in by a variable in another page
this is the current one:

Code: Select all

SELECT     TOP 30 LoadPercentage, LastCheck, ServerName
FROM         Gispen_Server_CPU_gebruik
WHERE     (ServerName LIKE 'sr0029')
ORDER BY LastCheck DESC
EDIT:
oh and i also want the lastcheck of the highest loadpercentage to show but i will figure that out later
Last edited by ryuuka on Tue Nov 07, 2006 3:04 am, edited 2 times in total.
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

Is there a reason why you posted this twice? :?
ryuuka
Forum Contributor
Posts: 128
Joined: Tue Sep 05, 2006 8:18 am
Location: the netherlands

Post by ryuuka »

had a website time out on posting i refreshed it
so i guess thats the reason

edit:
sorry about that
other post has been deleted
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post by ody »

Why half an hour? it can be easily done using a single query if you done it by the hour.
Post Reply