On Sun, Nov 9, 2008 at 1:40 PM, Tejas <[EMAIL PROTECTED]> wrote:

> Hi all,
>
> I have a table 'stats' with following schema
> date varchar (25), utilization int, os_name varchar(25) ...
>
> I am recording host utilization for windows and linux operating systems
> (os_names) at various times in a day in this table. The date column has a
> format of yyyy-mm-dd.
>
> I want to do the following:
> 1. select top utilization for each day for all days recorded so far.
> 2. display a table with columns: date, utilization_linux,
> utilization_windows from the recorded data.
>
> any idea how to structure a query?
> for item 1 I am using the following query but it gives me only one row of
> max utilization so far.
> "select date, max(utilization) from stats where os='win2k3' and date in
> (select distinct date from stats ) order by date;"


If I understand you correctly, what you want can be provided by GROUP BY:


select date, max(utilization) from stats where os='win2k3' group by date



-- 
-- Stevie-O
Real programmers use COPY CON PROGRAM.EXE
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to