Number of records in the interval of 30 minutes.

Hi all

I'm trying to find the number of records in 30-minute intervals. Having said that, I am discovering many records I get in 30 minutes. In my table, I have a column called 'Last_UPDATE_DATE' with the date and time. Can someone help me, ways to achieve. I tried to think about how to get, but do not get the required information.

Hello

as Pablolee suggested, it is not easy to understand without examples of data.

Here's a possible solution:

with timeranges as

(

Select trunc (sysdate) +(level-1) *(30/24/60) starttime

trunc (sysdate) + (level) *(30/24/60) endtime

from dual connect by level<=>

)

Select b.starttime, count (*)

from yourtable one

Join timeranges b

on (a.last_update_date > = b.starttime and a.last_update_date)<>

B.starttime group;

If it does not match your need please post some sample data (check the Re: 2. How can I ask a question on the forums?)

and validate the information to reproduce your case.

Kind regards.

Alberto

Tags: Database

Similar Questions

  • How can I recover only odd or even number of records in the table?

    Hello

    How can I recover only odd or even number of records in the table?

    Thank you

    Hi IndiMinds,

    Alternatively, you can use in queries. :

    Odd:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 1;

    Still:

    SELECT *.

    Of

    (SELECT rownum row_count, id, name FROM bigemp

    )

    WHERE mod (row_count, 2) = 0;

    Thank you

  • Number of records in the top of the report page

    Hello
    IAM trying to display the total number of records in the upper part (I have not posted in the footer) of my report classic/IR using the below javascript but somehow, is not working. I appreciate any suggestion on this subject,
    < Input id = "numrowsGet" type = "hidden" value = "" #TOTAL_ROWS # "/ >"
    < script type = "text/javascript" >
    If (document.getElementById("numrowsGet").value is "0")
    assign value to {0;
    }
    on the other
    {
    document.getElementById("P11_RECORD_COUNTS").value = document.getElementById ("numrowsGet") .value;
    }
    < /script >

    .. .THX

    Once the page is rendered, then you see the numrowsGet article and its value in the view source?

    Why not try this adding in the header of the region as

    Row Count: #TOTAL_ROWS#
    

    http://docs.Oracle.com/CD/E23903_01/doc/doc.41/e21674/ui_region.htm#HTMDB25572

  • Number of records in the repeat region

    I have a page with a repeat region, which displays the records in Table1. Table1 is related to the Table2 (one to several, MS Access). I want to do is show the number of records in Table2 that are associated with a given row from Table1 shown in the repeat region.

    Think of how many responses listed next to each message in this forum, because that's basically what I do. As it is now, I get the correct number of records for the first line of Table1 shown in the repeat region, but this number is indicated in each line. In other words, if the first record displayed from Table1 has 3 matching records in table 2, 3 number in each row in the repeat region.

    I appreciate all the help that I'm a complete novice.

    Maybe it is not very effective, but I bet you it will do what you want:


    SELECT *.
    FROM table1
    ORDER BY name DESC


    SELECT *.
    FROM table2
    Where tid = #table1.id #.


    #table1.name #.
    #table1.client #.
    #table1.products #.
    $# numberformat (table1.income, '999,999.99') #.
    #table1.frequency #.
    #table2. RecordCount #.

  • difference in number of records in the table of audit

    Hi all

    We strive to remove lines of verification based on timestamp(sysdate-30) table(sys.aud$). The command I used below.

    SQL > set lines 200

    COL OWNER FORMAT A15

    Select TABLE_NAME, nom_tablespace, OWNER, num_rows, STATUS, DEGREE, TABLE_LOCK, LAST_ANALYZED, PARTITIONED, USER_STATS from dba_tables where TABLE_NAME = '& TABLE_NAME';

    SQL > SQL > type table_name value: AUD$

    OWNER, TABLE_NAME, NUM_ROWS STATUS DEGREE TABLE_LO LAST_ANALY BY USING NOM_TABLESPACE

    --------------- ------------------------------ ------------------------------ ---------- -------- ---------- -------- ---------- --- ---

    SYS AUD$ 934991 SYSTEM VALID ACTIVE 1 08/07/2012 No. No.

    SQL > delete / * + parallel (aud$ 8) * / of sys.aud$ where NTIMESTAMP # < sysdate-30; (I don't know why I put NTIMESTAMP #, although I see # aud TIMESTAMP column $ table, the above query, I got from sr dba)

    3140994 deleted rows. (reason why so many records have been deleted I see 934991 lines from dba_tables view)


    After that I saw the difference in number of records.


    SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where TIMESTAMP # < sysdate-30;

    COUNT (*)

    ----------

    0

    SQL > select / * + parallel (aud$ 8) * / count (*) from sys.aud$ where NTIMESTAMP # < sysdate-30; -> Why there are differences in the number of records if I put NTIMESTAMP #in query)


    COUNT (*)

    ----------

    50

    Thank you

    Bhavani.

    SQL > SELECT count (*) from sys.aud$ where ntimestamp #.<>

    COUNT (*)
    ----------
    0

    Try this one.  Good luck.

  • by comparing the number of records in the table child

    I have 3 tables below:

    Table 1 - Parent Table
    Table table2 child - who has the number of records for each record in Table1 (row_id in Table1 corresponds to par_row_id in Table2)
    Child table table 3 - has that number of records for each record in Table1 (row_id in Table1 corresponds to par_row_id in table 3)

    I would like to run an Oracle SQL query to identify all the separate row_id on Table1, for which the number of child records in Table2 does not match the number of child records in Table3

    I ask for help to identify the best way to identify these records in the parent table. If possible an example too, please.

    Thank you

    Published by: cseshan on February 3, 2013 01:35

    All by adding the simplest example (with the sample data that you were supposed to provide) below

    create table table1(row_id number primary key);
    
    create table table2(par_row_id number references table1);
    
    create table table3(par_row_id number references table1);
    
    insert into table1 values(1);
    insert into table2 values(1);
    insert into table3 values(1);
    
    insert into table1 values(2);
    insert into table2 values(2);
    insert into table2 values(2);
    
    insert into table1 values(3);
    insert into table3 values(3);
    insert into table3 values(3);
    
    insert into table1 values(4);
    insert into table2 values(4);
    insert into table2 values(4);
    insert into table2 values(4);
    insert into table3 values(4);
    insert into table3 values(4);
    
    commit;
    
    with child1_cnt as
    (
      select par_row_id,count(*) cnt
      from table2
      group by par_row_id
    ),
    child2_cnt as
    (
      select par_row_id,count(*) cnt
      from table3
      group by par_row_id
    ),
    all_counts as
    (
      select p.row_id,nvl(c1.cnt,0) c1_cnt,nvl(c2.cnt,0) c2_cnt
      from table1 p
       left outer join child1_cnt c1
         on ( p.row_id = c1.par_row_id )
       left outer join child2_cnt c2
         on ( p.row_id = c2.par_row_id )
    )
    select row_id,c1_cnt,c2_cnt
    from all_counts
    where c1_cnt != c2_cnt;
    
    ROW_ID C1_CNT C2_CNT
    ------ ------ ------
         2      2      0
         4      3      2
         3      0      2 
    
  • Difference in the number of records for the same date - 11 GR 2

    Guy - 11 GR on Windows2005 2, 64-bit.

    BILLING_RECORD_KPN_ESP - is a monthly partitioned table.
    BILLING_RECORD_IDX #DATE - is a local index on "charge_date" in the table above.

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    2 (trunc (CHARGE_DATE)) CHARGE_DATE;
    3 count (1) Record_count
    4. IN "RATOR_CDR". "" BILLING_RECORD_KPN_ESP ".
    where the 5 CHARGE_DATE = January 20, 2013.
    Group 6 by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    2401 20 January 13-> > some records here.

    -> > Here I can see only '2041' records for Jan/20. But in the query below, it shows "192610" for the same date.

    Why is this difference in the number of records?

    SQL > select / * + index (BILLING_RECORD_KPN_ESP BILLING_RECORD_IDX #DATE) * /.
    (trunc (CHARGE_DATE)) CHARGE_DATE,
    2 count (1) Record_count
    3. FOR "RATOR_CDR." "" BILLING_RECORD_KPN_ESP ".
    "4 where CHARGE_DATE > 20 January 2013."
    Group of 5 by trunc (CHARGE_DATE)
    6 order by trunc (CHARGE_DATE)
    5 m

    CHARGE_DATE RECORD_COUNT
    ------------------ ------------
    192610 20 January 13-> > more records here
    JANUARY 21, 13 463067
    JANUARY 22, 13 520041
    23 JANUARY 13 451212
    JANUARY 24, 13 463273
    JANUARY 25, 13 403276
    JANUARY 26, 13 112077
    27 JANUARY 13 10478
    28 JANUARY 13 39158

    Thank you!

    Because in the second example you also select rows that have a nonzero component.

    The first example selects only rows that are 00:00:00

    (by the way, you should ask questions like this in the forum SQL)

  • Get number of records in the date range - IDE: PLSQL Developer

    I want to count the number of records of members who register within a date range specified, based on effective and expiration dates and their "elg_code". I posted the SQL code for some examples of data. What I would like to see returned is in three columns of the counties where the eff_date date_exp members fall within the date range specified by the SQL and have an Elg_code of ' ' (space).

    So what I would like is all members with elg_code ' ' where he eff_dt and exp_dt range is April 2012, 2012 MAY & JUN 2012. Thus, according to data from the sample I posted, Mark, where his elg_code record is ' ', his eff_dt is 01/01/2011 and April 2012 (30/04/2012) is his exp_dt. Range of the brand statement may 2012, but not MAY or JUNE of 2012. Marty would tally for the APR and MAY because his eff_dt is before MAY 2012 and his exp to MAY 2012. etc...

    According to the data below, the results should resemble:

    APR MAY JUN
    4-3-2

    APR should have FRANK, MARK, MARTY, MARY.
    MAY should have FRANK, MARTY, MARY
    JUN should have FRANK and MARIE

    NOAM and JOHN should not appear as his records with elg_code ' ' have no documents eff_dt and exp_dt which are April-June 2012.

    So what I tried without success as it appears that I have a kind of Cartesian question (?), is:

    Select count (m1.mbr_name) APR,
    Count (m2.mbr_name) MAY,
    Count (m3.mbr_name) JUN
    mbr2 M1,
    mbr2 m2,
    mbr2 m3
    "where m1.eff_dt < ' 01 - may - 2012"
    "and m1.exp_dt > ' 01-Apr-2012.
    and m1.elg_code = ' '
    "and m2.eff_dt < 1 June 2012"
    "and m2.exp_dt > ' 01 - may - 2012"
    and m2.elg_code = ' '
    "and m3.eff_dt < 1 July 2012"
    "and m3.exp_dt > 1 June 2012"
    and m3.elg_code = ' '


    Here's the DML

    Thanks for any help!


    create table mbr2 (mbr_name varchar (10), varchar (1) grpid eff_dt date, date of exp_dt elg_code varchar (1))
    Commit

    insert into mbr2 values ('BRAND', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (April 30, 2012 ',' DD-MM-YYYY '), ' ')
    insert into mbr2 values ('BRAND', 'A', to_date (May 1, 2012 ',' DD-MM-YYYY '), to_date (31 December 2013 ',' DD-MM-YYYY '), 'C')

    insert into mbr2 values ('MARTY', 'A', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (May 31, 2012 ',' DD-MM-YYYY '), ' ')
    insert into mbr2 values ('MARTY', 'A', to_date (June 1, 2012 ',' DD-MM-YYYY '), to_date (31 December 2013 ',' DD-MM-YYYY '), 'C')

    insert into mbr2 values ('FRANK', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (June 30, 2012 ',' DD-MM-YYYY '), ' ')
    insert into mbr2 values ('FRANK', 'B', to_date (July 1, 2012 ',' DD-MM-YYYY '), to_date (31 December 2013 ',' DD-MM-YYYY ""), 'C')

    insert into mbr2 values ('MARY', 'B', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (June 30, 2012 ',' DD-MM-YYYY '), ' ')
    insert into mbr2 values ('MARY', 'B', to_date (July 1, 2012 ',' DD-MM-YYYY '), to_date (31 December 2013 ',' DD-MM-YYYY ""), 'C')

    insert into mbr2 values ('JOHN', 'C', to_date (January 1, 2011 ',' DD-MM-YYYY '), to_date (July 1, 2011 ',' DD-MM-YYYY '), ' ')
    insert into mbr2 values ('JOHN', 'C', to_date (July 1, 2011 ',' DD-MM-YYYY '), to_date (1 January 2012 ',' DD-MM-YYYY ""), 'C')

    insert into mbr2 values ("NOAM" 'd', to_date (July 1, 2012 ',' DD-MM-YYYY '), to_date (31 December 2013 ',' DD-MM-YYYY '), ' ' ")

    Commit

    This gives you a report for the current month and the two front. Column header must be adjusted ;-)

    select
      count(
      case
      when
        eff_dt < add_months(trunc(sysdate,'MM'), -1)
        and
        exp_dt >= add_months(trunc(sysdate,'MM'), -2)
      then 1
      end) April
    , count(
      case
      when
        eff_dt < add_months(trunc(sysdate,'MM'), 0)
        and
        exp_dt >= add_months(trunc(sysdate,'MM'), -1)
      then 1
      end) May
    , count(
      case
      when
        eff_dt < add_months(trunc(sysdate,'MM'), 1)
        and
        exp_dt >= add_months(trunc(sysdate,'MM'), 0)
      then 1
      end) June
    from mbr2
    where
    elg_code = ' '
    and
    eff_dt < add_months(trunc(sysdate,'MM'), 1)
    and
    exp_dt >= add_months(trunc(sysdate,'MM'), -2)
    
    APRIL     MAY     JUNE
    4     3     2
    
  • Total number of records in the table read

    Here is the procedure to read total no of record in the table specified by the user during execution. But it still gives the same answer for all the table. Can someone help me?

    create or replace procedure p3 (varchar2, not on the number tab)
    as
    Start
    Select count (*) from no tab;
    end;

    You need dynamic SQL statements.

    Or:
    http://laurentschneider.com/wordpress/2007/04/how-do-i-store-the-counts-of-all-tables.html
    To get the name of the Table and no lines
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:1725645184471282:P11_QUESTION_ID:1660875645686

    Or simply use the data dictionary, collect statistics of the table, then:
    Select table_name, num_rows from user_tables;

  • Limit the number of records in the PivotTable

    Hello

    How can I display only first 10 runners in a custom report?

    Thank you.

    Hi Luis Simioni

    It is very very very simple.
    Select the State of the active or active history
    Include columns, the name of the account, active, quantity and once again the amount.
    In the fourth column of quantity, please apply the formula (partially fx) RANK ('-quantity "." ") Quantity per account. The account name')
    After the application of the formula, you select the filter lower at 11.
    You can hide the fourth column.

    The RANK function would rank each asset based on their quantity. We apply the sentence per account. "" Account name " while the ranking is done separately for each account name. We then apply the filter under 11, while only 10 records are displayed in the report.

    Once the number of records is limited, then you can apply the pivot accordingly and get the result.

    Let me know if you are still facing problems.
    You can send me to [email protected] for any question.

    Kind regards

    Paul

    Published by: Paul-CRMIT May 19, 2011 11:17

  • How to change the number of records from the 25 to the different number?

    Hi friends...
    Generally, table 25 records at a time, and if registration exceeds the number there is a next button appears below the table. I need to change the number of records? Help, please.

    Thank you

    Hello...

    Try this, in the instanceconfig.xml file,



    50

    It works...

    Thank you & best regards
    Kishore Guggilla

  • Gets the number of records in the report based on the input of the user on the date and the number of days.

    Hello

    I need where there are quick dashboard that selects the date, second interval column consists of >, <, = and the third column is seen number (in days)

    for example, the user enters: 12 18, 2015, <, 9. here I report who should get the data (records) 9 days earlier from the date specified (from 12/10/2015 to 18/12/2015).

    Similarly for > =.

    How to get there. I'm unable to write the script and I use the column date in my report. Ask that you please advice how to solve this problem.

    Please find below the screen for reference.

    timediff.jpg

    Kind regards

    Chandra Khalil.

    Hello

    Not exactly why you're doing the report this way. If the user must select, basically, a period of dates, would not easier to have a column of data with a between the operator and the user would select 2 dates (upper and lower intervals)?

    In any case, it is possible to achieve what you want to do as a result of your approach. You could use when's CASE and have a more complex filter, but I think that it is better to have a few nested filters where you use the range operator to determine what date filter that you use (see image below)

    Some notes about my filter. First of all, I am making the assumption that the operator is "=", then the number of days specified must be ignored and you just return the data for the selected date. You will notice also that in my filters, I got a cast so far, but if you are using a column that is already a timestamp so it won't be necessary.

    This should achieve what you want.

    See you soon,.

    Pedro

  • How to add the number of records at the foot of the page in the file

    Hello

    I need to get the number of footer lines in the file.

    I need to format footer below

    County: 14.

    How can I achieve this?

    Thanks for your ideas.

    Sébastien.

    Another option which is independent of the operating system would be to

    (1) put in place a refreshing variable that returns the number of rows

    (2) use the OdiOutFile tool to add the result at the end of the file required by passing the variable as the value in the TEXT of the tool parameter

  • Display the master data on the time interval of 5 minutes

    I tried my way, but cannot resolve the requirement of below mentioned desire please help me solve this question please.

    I need to show the presence of the employee, but one record within the interval of 5 minutes of the old time recorded as shown below

    Time                                            EMP_ID

    16/11/2015 10:01:11 193

    16/11/2015 09:55:11 193

    16/11/2015 09:54:18 193

    16/11/2015 09:53:24 193

    16/11/2015 09:52:11 193

    16/11/2015 09:51:18 193

    16/11/2015 09:50:24 193

    16/11/2015 09:49:29 193

    16/11/2015 09:48:38 193

    13/11/2015 09:36:38 190

    13/11/2015 09:33:38 190

    13/11/2015 09:30:11 190

    Power required

    Time                                            EMP_ID

    16/11/2015 10:01:11 193

    16/11/2015 09:54:18 193

    16/11/2015 09:48:38 193

    13/11/2015 09:36:38 190

    13/11/2015 09:30:11 190

    I want to show the minimum date and time with in the 5 minute interval

    Your solution is not what he wants to be (your result set is the same as mine, anyway).  He wants to roll every 5 minutes starting with a given record.  Here's one way:

    with qry (ATIME, EMP_ID) as long as)

    Select to_date('16/11/2015 10:01:11 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:55:11 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:54:18 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:53:24 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:52:11 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:51:18 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:50:24 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:49:29 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('16/11/2015 9:48:38 AM', 'dd/mm/yyyy hh:mi:ss AM'), 193 of union double all the

    Select to_date('13/11/2015 9:36:38 AM', 'dd/mm/yyyy hh:mi:ss AM'), 190 Union double all the

    Select to_date('13/11/2015 9:33:38 AM', 'dd/mm/yyyy hh:mi:ss AM'), 190 Union double all the

    Select to_date('13/11/2015 9:30:11 AM', 'dd/mm/yyyy hh:mi:ss AM'), 190 double

    )

    Select EMP_ID, ATIME

    (select EMP_ID, ATIME, min (ATIME) on (EMP_ID partition) as START_ATIME,

    min (atime) over (partition by order EMP_ID of ATIME

    range between the minute rest interval '5'

    and unbounded following) as NEXT_ATIME

    of qry)

    Start by ATIME = START_ATIME

    connect by prior NEXT_ATIME = ATIME

    What gives exactly what he wants

    EMP_ID ATIME
    190 13/11/2015-09:30:11
    190 13/11/2015-09:36:38
    193 16/11/2015-09:48:38
    193 16/11/2015-09:54:18
    193 16/11/2015-10:01:11
  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

Maybe you are looking for