- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Aggregation Question
Operating System - HP-UX
1748080
Members
5076
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2003 01:46 AM
тАО07-23-2003 01:46 AM
Aggregation Question
Hi,
Anyone know the syntax to generate a list of a count for records over a 24 day period.What I want to know is query the database and get records stored in table date field per hour.
Thanks in advance!
Anyone know the syntax to generate a list of a count for records over a 24 day period.What I want to know is query the database and get records stored in table date field per hour.
Thanks in advance!
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2003 02:54 AM
тАО07-23-2003 02:54 AM
Re: Aggregation Question
hi,
can you try something like this one:
select mnumrows, to_char(mdate, 'dd/mm/yyyy hh24:mi')
from (
select count(*) mnumrows, trunc(trndat,'HH') mdate
from mytable
where trndat > sysdate-25
group by trunc(trndat,'HH')
)
/
hope this helps!
regards
Yogeeraj
can you try something like this one:
select mnumrows, to_char(mdate, 'dd/mm/yyyy hh24:mi')
from (
select count(*) mnumrows, trunc(trndat,'HH') mdate
from mytable
where trndat > sysdate-25
group by trunc(trndat,'HH')
)
/
hope this helps!
regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2003 03:01 AM
тАО07-23-2003 03:01 AM
Re: Aggregation Question
hi again,
This is what i get on my test database (output has been limited to first 10 records)
yd@MYDB.MU> r
1 select mnumrows, to_char(mdate, 'dd/mm/yyyy hh24:mi')
2 from (
3 select count(*) mnumrows, trunc(trndat,'HH') mdate
4 from mytable
5 where trndat > sysdate-25
6 group by trunc(trndat,'HH'))
7* where rownum < 11
MNUMROWS TO_CHAR(MDATE,'D
__________ ________________
9 28/06/2003 14:00
46 28/06/2003 15:00
396 30/06/2003 08:00
403 30/06/2003 09:00
579 30/06/2003 10:00
414 30/06/2003 11:00
219 30/06/2003 12:00
604 30/06/2003 13:00
229 30/06/2003 14:00
230 30/06/2003 15:00
10 rows selected.
Elapsed: 00:00:00.16
yd@MYDB.MU>
Am sure other solutions do exits if you use Analytic Functions.
best regards
Yogeeraj
This is what i get on my test database (output has been limited to first 10 records)
yd@MYDB.MU> r
1 select mnumrows, to_char(mdate, 'dd/mm/yyyy hh24:mi')
2 from (
3 select count(*) mnumrows, trunc(trndat,'HH') mdate
4 from mytable
5 where trndat > sysdate-25
6 group by trunc(trndat,'HH'))
7* where rownum < 11
MNUMROWS TO_CHAR(MDATE,'D
__________ ________________
9 28/06/2003 14:00
46 28/06/2003 15:00
396 30/06/2003 08:00
403 30/06/2003 09:00
579 30/06/2003 10:00
414 30/06/2003 11:00
219 30/06/2003 12:00
604 30/06/2003 13:00
229 30/06/2003 14:00
230 30/06/2003 15:00
10 rows selected.
Elapsed: 00:00:00.16
yd@MYDB.MU>
Am sure other solutions do exits if you use Analytic Functions.
best regards
Yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-23-2003 03:21 AM
тАО07-23-2003 03:21 AM
Re: Aggregation Question
Hi Yogee!
Thanks man, You pointed me in the right directiorn!
Most appraciated!
Thanks man, You pointed me in the right directiorn!
Most appraciated!
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP