Query to retrieve the number of transactions done in every 1 hour for last

Hi,
Could anyone help in writing a query to retrieve the number of transactions done in every 1 hour for last month.
Case:
I/P
Cases Timestamp1
case1 01-01-2008 00:00:01
case2 01-01-2008 00:01:01
case3 01-01-2008 01:00:01
case1 01-01-2008 01:02:01
case4 01-01-2008 01:10:01
case5 02-01-2008 02:00:01
case6 02-01-2008 02:10:01
case7 02-01-2008 23:00:01
case.. 31-01-2008 24:00:00
O/P
from time to_time cases
01-01-2008 00:00:00 01-01-2008 01:00:00 2
01-01-2008 01:00:01 01-01-2008 02:00:00 3
etc
Any help really appreciated

We can do this using analytical functions
Following is what I did:
create table timestamp1 (ts date)
select *from timestamp1
30/10/2008 15:41:13
30/10/2008 15:41:05
30/10/2008 15:40:03
30/10/2008 14:58:26
30/10/2008 14:29:45
30/10/2008 13:17:48
30/10/2008 08:29:50
30/10/2008 06:05:51
30/10/2008 03:41:52
30/10/2008 02:29:54
select distinct to_char(ts,'hh24') frmhrs,
to_char(ts,'hh24')+1 tohrs, count(ts) OVER (order by to_number(to_char(ts,'hh24')) RANGE (1/24) PRECEDING )
from timestamp1
where trunc(ts)=trunc(sysdate) -- I added this just to make sure I get for today's data
order by frmhrs
FRMHRS     TOHRS     CNT
02     3     1
03     4     1
06     7     1
08     9     1
13     14     1
14     15     2
15     16     3
You can customizeas per ur need.

Similar Messages

  • How to retrieve the number of "free" rows in a table?

    Hi,
    if in a client only environment (no sync to mobile server) rows are inserted and deleted into a table,
    is there a way to retrieve the number of "free" rows in a table? Number of "Free" rows stands for
    number of rows that can be inserted again, before the table extents in size.
    Is there a way in OLite 10.3.0.2.0 to retrieve the size of tables and indexes? ALL_TABLES is not
    a place that really works.
    Best regards and many thanks,
    Gerd

    Hi Gary,
    many thanks, the partner uses a Lite client db without sync. The db runs inside an laboratory device and collects measures. There must be a way to estimate the the number of "measures" rows, that stil can be stored in the db.
    Than we need to make the deleted space available for new rows. The partner tested defrag.exe and found that it
    needs very long time to run, especially if the db is bigger than 2GB. ... and that this run sometimes fails.
    Is there any recommendation the partner can follow on?
    Thanks,
    Gerd

  • FMor Bapi to get the number of transactions in SM35 for the session name

    Hello All,
    Can you anybody give me a function module or bapi to get the number of transactions in SM35 for the session name.
    Can anybody help me out in this issue.
    Thanks

    Hello Maroz,
    Thanks for the help.But can you provide me a FM or BAPI.
    Thanks

  • How to increase the number of data Business Object can pull for a report?

    Hi,
    I would like to ask around how to increase the number of data Business Object can pull for a report. I have a report which pulls data depending on the date range (ex. From 01/01/2007 - 01/10/2007). But, when the data that is pulled exceeds 5000, the report fails. Is there anyway to increase the number of data that BO can pull?
    Thanks

    Bobby,
       to my knowledge we can't change that. Let me explain this, we have setting in the source system for DS default Data Transfer. there we will assign the processes. if you want to assign 4 you need to change the setting in the source system. For flat files we can change in BW System. We can maintain the setting in the Infopackage level(wht we are assigned in the Source System), but we can't change the process.
    in order to check the setting in source system  SBIW--> General Settings --> Control Parameters for Data Transfer.
    we need to change here, this will effect to all the Data Sources. Before making changes check with your basis.
    All the best.
    Regards,
    Nagesh Ganisetti.

  • I am deleting all my old versions of  Lightroom and want to install the newest version , I don't pay extra for that right? It's still part of doing  the creative cloud monthly  cost right?

    I am deleting all my old versions of  Lightroom and want to install the newest version , I don't pay extra for that right? It's still part of doing  the creative cloud monthly  cost right?

    Correct, if you've got the Photography Plan or the Cloud Complete Plan.

  • How do I know  what transactions executed by specific user for last month

    All
    We have a request to find out  what transactions are executed by secific user
    for last couple of months.
    Is there any report in SAP would tell me ?
    Please advise.
    From
    PT.

    Hello PT,
    If you use the search for the term "How do I know what transactions executed by specific user for last month" then I guarantee you some good hits in the result, and further more detailed search terms to use...
    Cheers,
    Julius
    (this time in response to the correct thread...)

  • WebDAV Query generates a high number of transaction log files

    Hi all,
    I have a program that launch WebDAV queries to search for contacts on an Exchange 2007 server. The number of contacts returned for each user's mailbox is quite high (about 4500).
    I've noticed that each time the query is launched, about 15 transaction log files are generated on the Exchange server (each of them 1Mb). If I ask only for 2 properties on the contacts, this number is reduced to about 8.
    This is a problem since our program is supposed to launch often (about every 3/5min) as It will synchronize Exchange mailboxes with a SQL Server DB. The result is that the logs increase very quickly on the server side, even if there are not so many updates.
    Any idea why so many transaction logs are generated when doing a WebDAV search returning many items? I would understand that logs are created when an update is done on the server, but here it's only a search with many contacts items returned.
    Is there maybe a setting on the Exchange server to control what kind of logs to generate?
    Thank for your help,
    Alexandre

    Hi Alex,
    Actually circular logging/backup was not a solution, I was just explaining that there is an option like that on server but it is not recommended hence not useful in our case :)
    - I am not a developer but AFAIK, WebDAV search query shouldn't generate transaction log because it just searches the mailboxes and gives the result in HTTP format and doesn't produce any Exchange transaction.
    - I wouldn't open transaction logs since it is being used by Exchange which may generate errors and may corrupt Exchange database sometime too. However it is not readable, as you observed, other than Exchange Information Store service (store.exe).
    - You can post this query in development forum to get better idea on this, if any other programmer observed similar symptom while using WebDAV contact search query in Exchange 2007 or can validate your query.
    Microsoft TechNet > Forums Home > Exchange Server > Development
    Well, I just saw that you are using Exchange 2007, in that case why don't you use Exchange Web Service which is better and improved method to access/query mailboxes where as WebDAV is also de-emphasized in Exchange 2007 and might be disappeared in next version of Exchange. Checkout below article for further detail.
    Development: Overview
    http://technet.microsoft.com/en-us/library/aa997614.aspx
    Amit Tank | MVP - Exchange | MCITP:EMA MCSA:M | http://ExchangeShare.WordPress.com

  • How to find the number of transactions recorded in R/3

    Hi guys,
    I wanted to know the number of all the transactions recorded in R/3 in a time period.
    Points for helping.
    Thanks

    Hi Prasun,
    You can use tcode: STAT
    Regards,
    Ankit

  • SQL Query to retrieve the All records based on the Max Dates.

    Hello all,
    I am trying to retrieve the newest record based on the date field (  nextDate  ).
    Currently there are only 4 records in the MC_Maintenance table and two in the Machine table.
    Machine table
    MC_id             EquipID          
    1                      0227
    MC_id             EquipID
    2                     0228
    MC_Maintenance table
    Maint_id           MC_id             Next_maint                  
    1                      2                      08/25/2010     
    2                      2                      07/01/2010
    3                      1                      06/11/2010
    4                      1                      07/11/2010
    What I  am trying to accomplish is,
    list the two machines from the Machine table with the MAX(Next_maint) controlling the MC_Maintenance output list
    These are the records that I would like to Display.
    Maint_id           MC_id             Next_maint                  
    1                      2                      08/25/2010
    4                      1                      07/11/2010                 
    Below is the SQL Query
    SELECT
           MC.MC_ID as ID,
            MC.complete_Date as completed,
            MC.next_maint as nextDate,
            MC.maint_notes as Notes,
            MC.facility as Facility,
            M.EquipId,
            M.name as name,
            M.SerialNumber as SN,
            M.dept as dept,
            M.Freq as freq
            From  MC_Maintenance MC, Machine M
            where  MC.MC_ID =  M.MC_ID
    '           USING MAX(nextDate )
    Any ideas would help.
    TJ

    I would have thought that was a simple group by problem?
    SELECT M.EquipID, MC.MC_ID, Max(MC.next_maint)
    FROM MC_Maintenance MC INNER JOIN Machine M ON MC.MC_ID = M.MC_ID
    GROUP BY M.EquipID, MC.MC_ID

  • Query - Cannot Retrieve the Data / Result Set

    Hello,
    I'm trying to query a cube through the OLAP connection using Java and every time I try to execute a query an exception is thrown stating "Cannot retrieve the data set" or "Cannot retrieve the result set" depending on how I'm doing the query.  I've tried to execute the query both through the use of an IBIQuery and IBICommandProcessor object as well as directly through the IBIOlap connection via an MDX statement and both methods produce the same exception.  If anyone can shed some light on why exception is being thrown it would be greatly appreciated.

    please help me ... The question has nothing to do with 'getting' data from excel and certainly not with putting it into MySQL.
    The stack trace specifically tells you that your connection string is wrong.
    It also tells you which connection string is wrong.
    Which you can use to determine specifically which one is wrong. And which you did not provide that info to us.

  • Query to retrieve the records which have more than one assignment_id

    Hello,
    I am trying to write a query to retrieve all the records from the table per_all_assignments_f which has more than one different assignment_id for each person_id. Below is the query i have written but this retrieves the records even if a person_id has duplicate assignment_id's but i need records which have more than one assignement_id with no duplicates for each person_id
    select assignment_id ,person_id, assignment_id
    From per_all_assignments_f
    having count(assignment_id) >1
    group by person_id, assignment_id
    Thank You.
    PK

    Maybe something like this?
    select *
    From   per_all_assignments_f f1
    where  exists (select 1
                   from   per_all_assignments_f f2
                   where  f2.person_id = f1.person_id
                   and    f2.assignment_id != f1.assignment_id
                  );Edited by: SomeoneElse on May 7, 2010 2:23 PM
    (you can add a DISTINCT to the outer query if you need to)

  • Query to find the latest two transactions for each Group

    Hi All,
    Consider the following sets of records in a table test.
    Group---Tran_Dt---SlNo
    c1 10/10/2003 1
    c1 10/10/2003 2
    c1 10/10/2003 3
    c1 11/10/2003 1
    c2 10/10/2003 1
    c2 10/10/2003 2
    c2 11/10/2003 1
    c2 11/10/2003 2
    c2 11/10/2003 3
    c3 10/10/2003 1
    c3 10/10/2003 2
    c3 10/10/2003 3
    I want to list out the latest two transactions for each group irrespective of the slno and trans_dt as below:
    group tran_dt SlNo
    c1 11/10/2003 1
    c1 10/10/2003 3
    c2 11/10/2003 3
    c2 11/10/2003 2
    c3 10/10/2003 3
    c3 10/10/2003 2
    Any help on this would be appreciated.
    Thanks
    Walter Nicholas T

    Hi Walter,
    Please try following query.
    select Group,tran_dt,sino from
    select Group,tran_dt,sino,(DENSE_RANK()OVER (PARTITION BY Group ORDER BY tran_dt desc,sino desc)) rank from test
    ) where rank between 1 and 2
    Thanks,
    Samir

  • Result Set - How to retrieve the number of rows in resultset

    harlo....everyone.
    i m new in this language and would like to ask that how can i store the result into an array or u all hav others ideal to do it......? Hopefully can get answer asap....thanksssss.
    Below is the source code that i did. Please comment it
    ResultSet rs = stmt.executeQuery("Select CCourse_Code from RegisteredCourse, Student where Student.NStud_ID ='123'and Student.CStud_Pwd='123' and Student.NStud_ID = RegisteredCourse.NStud_ID ");
    if(rs!=null){
    // can i get the the number of records in resultset, rs to define my array size
    String course[] = new String[2];
    while(rs.next()){
    for(int i =0; i<course.length; i++)
    course[i] = rs.getString("ccourse_code");
    return course;

    Or...
    ResultSet rs = stmt.executeQuery("Select count(CCourse_Code) from RegisteredCourse, Student where Student.NStud_ID ='123'and Student.CStud_Pwd='123' and Student.NStud_ID = RegisteredCourse.NStud_ID ");
    This should return a table with one row and one column. This will hold the number originally requested.
    However I would still go with the ArrayList suggestion given above.

  • Sql query to  know the number of triggers and cursors present in a schema?

    friends,is there any way to know the number of triggers and cursors preseent in a schema.
    thanks in advance..

    what do you mean by triggers in a schema? is it the triggers owned by that schema? or the triggers applied on tables owned by that schema? remember you may own triggers applied on the tables belong to other schemas. Anyways, all this information can be extracted from oracle dictionary using a combination of all_triggers and all_tables.
    As far as cursors, please elaborate. Do you mean cursors declared in PL/SQL blocks?

  • Query to find the number of main meter and its corresponding sub meter

    Hi Expert,
    I need to build a query to derieve the main meter & it corresponding sub meter in SAP system
    Please could you let me the table which i should join

    Check out tables EQUI-EGERS-ETDZ
    Thanks,
    Murtuza

Maybe you are looking for

  • How can I get my playlists back after hard disc change?

    My hard disc crashed. After changing a new hard disc and installing iTunes again all my playlists were gone. I had the music files backed up and could import them back to iTunes libraries but the playlists are gone. I spent hours making them. Is ther

  • Duplication of Records in Address Book on iPad Sync

    I have multiple records which have been duplicated in my Address Book on my desktop Mac; I believe it has arisen since I have been synchronizing between desktop and iPad. How can I eliminate these duplicated record entries and stop this duplication?

  • Hover effect... made larger

    Hi... not the biggest web genius but know a little. I've set up a hover effect on some links to show a blue background when you roll over. The 'blue' surrounds the type pretty tight... the highlight colour  surrounds the text above and below but not

  • Need simple example on Soap With attachment webservice

    Hi I want to explore following points:- 1. How to create a webservice that accept attachment. 2. java Client to send the attachment to webservice 3. using OSB to send attachment to webservice? Does any have any example tht will help to understand thi

  • HT1386 Why when I download a new song is it showing in lighter italics & wont play?

    Why when I try to download a song from I tunes is it in light words & wont play on my i pod?