i'm trying to find peak connections for each day
select max(connections)as peak from peak_connections
where account_id ='1909' and incident_time between '2004-05-25' and '2004-05-26'
-- the above query returns only the peak for 5/25.
how do I write it so that when i execute the query it will return the peak for all dates.
some sample data is provided below.
thanks for your help.
May 25, 2004 1
May 25, 2004 0
May 25, 2004 1
May 25, 2004 0
May 25, 2004 1
May 25, 2004 2
May 25, 2004 2
May 25, 2004 3
May 25, 2004 4
May 25, 2004 5
May 25, 2004 4
May 25, 2004 5
May 25, 2004 6
May 25, 2004 7
May 25, 2004 8
May 25, 2004 7
May 25, 2004 8
May 25, 2004 7
May 25, 2004 8
May 25, 2004 7
May 25, 2004 8
May 25, 2004 9
May 25, 2004 10
May 25, 2004 11
May 25, 2004 11
May 25, 2004 12
May 25, 2004 13
May 25, 2004 14
May 25, 2004 13
May 25, 2004 12
May 25, 2004 10
May 25, 2004 9
May 25, 2004 8
May 25, 2004 7
May 25, 2004 6
May 25, 2004 5
May 25, 2004 4
May 25, 2004 3
May 25, 2004 3
May 25, 2004 3
May 25, 2004 4
May 25, 2004 3
May 25, 2004 4
May 25, 2004 5
May 25, 2004 6
May 25, 2004 7
May 25, 2004 8
May 25, 2004 8
May 25, 2004 9
May 25, 2004 8
May 25, 2004 7
May 25, 2004 6
May 25, 2004 7
May 25, 2004 6
May 25, 2004 7
May 25, 2004 6
May 25, 2004 7
May 25, 2004 6
May 25, 2004 5
May 25, 2004 5
May 25, 2004 4
May 25, 2004 3
May 25, 2004 2
May 25, 2004 1
May 26, 2004 1
May 26, 2004 0
May 26, 2004 1
May 26, 2004 2
May 26, 2004 1
May 26, 2004 1
May 26, 2004 1
May 26, 2004 2
May 26, 2004 3
May 26, 2004 4
May 26, 2004 3
May 26, 2004 4
May 26, 2004 3
May 26, 2004 4
May 26, 2004 5
May 26, 2004 6
May 26, 2004 7
May 26, 2004 8
May 26, 2004 9
May 26, 2004 9
May 26, 2004 8
May 26, 2004 7
May 26, 2004 6
May 26, 2004 5
May 26, 2004 4
May 26, 2004 3
May 26, 2004 4
May 26, 2004 3
May 26, 2004 4
May 26, 2004 4
May 26, 2004 5
May 26, 2004 3
May 26, 2004 2
May 26, 2004 1
May 27, 2004 1
May 27, 2004 1
May 27, 2004 2
May 27, 2004 1
May 27, 2004 2
May 27, 2004 2
May 27, 2004 1
May 27, 2004 2
May 27, 2004 3
May 27, 2004 2select incident_time, max(connections)as peak from peak_connections
where account_id ='1909' and incident_time between '2004-05-25' and '2004-05-26'
group by incident_time
Books Online, anyone?
Wednesday, March 28, 2012
help with sql
Labels:
account_id,
connections,
database,
dayselect,
max,
microsoft,
mysql,
oracle,
peak,
peak_connectionswhere,
server,
sql
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment