Query to retrieve past 1 hour data

Hi,
Pls tell me how to retrieve past 1 hour data from a table?
Thanks.

Maybe this will do ?
SQL> insert into emp (empno, ename, sal) values (6789,'ROB',1000)
  2  /
1 rij is aangemaakt.
SQL> select * from emp minus select * from emp as of timestamp sysdate - 1/24
  2  /
     EMPNO ENAME      JOB              MGR HIREDATE                   SAL       COMM     DEPTNO
      6789 ROB                                                       1000
1 rij is geselecteerd.Regards,
Rob.

Similar Messages

  • Query and retrieval of SAP table data

    Hi,
    Within PI Is it possible to use a select query on an ECC table and retrieve the relevant data. The data will then need to be mapped to the output.
    Can this be achieved through an RFC call?
    Thanks

    Hi,
    You can use RFC lookup and map the output to target field.
    view this article for step by step process...
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/40b64ca6-b1e3-2b10-4c9b-c48234ccea35
    Hope this helps....

  • ERROR MESSAGE WHEN DOING SIMPLE QUERY TO RETRIEVE LARGE AMOUNT OF DATA

    Hello,
    Am querying my database(mysql) and displaying my data in a
    DataGrid (Note that am using Flex 2.0)
    It works fine when the amount of data populating the grid is
    not much. But when I have large amount of data I get the following
    error message and the grid is not populated.
    ERROR 1
    faultCode:Server.Acknowledge.Failed
    faultString:'Didn't receive an acknowledge message'
    faultDetail: 'Was expecting
    mx.messaging.messages.AcknowledgeMessage, but receive Null'
    ERROR 2
    faultCode:Client.Error.DeliveryInDoubt
    faultString:'Channel disconnected'
    faultDetail: 'Channel disconnected before and acknowledge was
    received'
    Note that my datagrid is populated when I run the query on my
    Server but does not works on my client pcs.
    Your help would br greatly appreciated here.
    Awaiting a reply.
    Regards

    Hello,
    Am using remote object services.
    USing component (ColdFusion as destination).

  • 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.

  • Web Analysis Error -- Error while executing query and retrieving data

    Regarding Web Analysis:
    We have a number of reports that we created. yesterday they were all working fine. today we try to open them and most are generating an error.
    The error is:
    Error while executing query and retrieving data.; nested exception is:
    com.hyperion.ap.APException: [1033] Native:
    1013033[Thu Oct 22 09:08:17
    2009]server name/application name/database name/user name/Error91013033)
    ReportWriter exit abnormally
    Does anyone have any insight into what is going on?
    My version information is:
    Hyperion System 9 BI+ Analytic Administration Services 9.3.0.1.1 Build 2
    Web Analysis 9.3.0.0.0.286
    Thanks in advance for your help.
    DaveW

    Hi,
    And also click on check option by opening the query in Query designer,as Mr . Arun suggested.
    And if you get any error in checking, see the long message(detail).
    With rgds,
    Anil Kumar Sharma .P

  • Query to retrieve Identical names, same birth dates

    I have a table with these fields:
    table1 definition
    (ID varchar2(10),
    name1 varchar2(50),
    name2 varchar2(50),
    name3 varchar2(50),
    name4 varchar2(50),
    birthdt date)
    I need to write a query to retrieve the id's of those people that have identical first and last names AND were born on the same date. note that name is composed of four parts.
    I am trying this query
    (select id from table1 group by name1,name4,birthdt having count(name1)>1 and count(name4)>1 and count(birthdt)>1). I am not getting correct results.
    Any help appreciated.
    Ammar

    ¿...Doh...how could I miss that? smacks forehead
    Thanks ( for the N-th time ;) ) for setting straight, Solomon.
    Guess I wasn't completely recovered from yesterday ;)
    However, the basic approach wasn't too bad ;)
    But ofcourse the 'select *' should be 'select id'
    Using testdata:
    SQL> with table1 as ( -- generating sample data as I should have done in the first place:
      2  select 1 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      3  select 2 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jackson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      4  select 3 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('25-05-1989','dd-mm-yyyy') birthdt from dual union all
      5  select 4 id, 'Zlad' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual union all
      6  select 5 id, 'John' name1, 'James' name2, 'Joe' name3, 'Jameson' name4, to_date('15-05-1989','dd-mm-yyyy') birthdt from dual
      7  )
      8  --
      9  -- actual query
    10  --
    11  select id
    12  from ( select id
    13         ,      name1
    14         ,      name2
    15         ,      name3
    16         ,      name4
    17         ,      birthdt
    18         ,      count(*) over (partition by name1, name2, name3, name4, birthdt) recs
    19         from   table1
    20       )
    21  where recs > 1;
            ID
             1
             5

  • Query That Retrieves New Customers & Leads By Date

    Hello All --
    We would like to create a Query that retrieves new customers and leads based on the date (or date range) they are entered into SAP. 
    Can we create a UDF named STDATE --- Start Date -- and have a Query that allows us to select based on this date range?
    Start dates are entered in this format --- YYYYMMDD.
    Then, the Query would pull out:
    Contact...Company...Bill To Address...Bill To City...Bill To State....Bill To Zip...Phone...Email
    Is this possible to do?
    Thanks!
    Mike

    Hi Mike ,
    You can add some other field as you like .This report will give you combination of both customer and lead .
    I couldn't understand the purpose ,but I like previous query as i have flexibilty to choose customer or vendor .
    SELECT T0.[CreateDate], T0.[CntctPrsn], T0.[CardName], T0.[Address], T0.[City], T0.[E_Mail], T0.[ZipCode], T0.[Phone1] FROM OCRD T0 WHERE T0.[CardType] in ('C','L') and T0.[CreateDate]=[%0]
    If you agree with me ,you can use this query
    SELECT T0.[CreateDate], T0.[CntctPrsn], T0.[CardName], T0.[Address], T0.[City], T0.[E_Mail], T0.[ZipCode], T0.[Phone1] FROM OCRD T0 WHERE T0.[CardType] =[%0] or T0.[Cardtype]=[%1] and
    T0.[CreateDate]=[%2]
    Regarding the date issue , since you are entering paramenter it will match with the date you are looking for .If you have more than one customer created on same day , you willreceive multiple client .
    Thank you
    Bishal

  • Need efficient SQL query to retrieve data for MLM website

    Table cd_members
    MemberID LeftID RightID
    1 2 3
    2 4 5
    3 6 7
    4 8 -
    5 - -
    6 - -
    7 - -
    8 9 10
    9 - -
    10 - -
    i want to execute a query to retrieve downline of a member say MemberID 2
    o/p should be Records with MemberID 4,5,8,9,10
    i am using this query but don't know how to start from MembeID=2
    select a.memberid, a.tradingid, a.refid, a.parentid, a.node, a.leftid, a.rightid, b.memberid from cd_members a, cd_members b
    where (a.leftid=b.memberid or a.rightid=b.memberid)

    Again, assuming that the number of levels is known, you can just do N self joins (note that I intentionally go one level further than necessary in this case
    SQL> ed
    Wrote file afiedt.buf
      1  with t
      2    as
      3   (
      4      select 1 person, 2 left, 3 right from dual union all
      5      select 2, 4, 5 from dual union all
      6      select 3, 6, 7 from dual union all
      7      select 4, 8, null from dual union all
      8      select 5, null, null from dual union all
      9      select 6, null, null from dual union all
    10      select 7, null, null from dual union all
    11      select 8, 9, 10 from dual union all
    12      select 9, null, null from dual union all
    13      select 10, null, null from dual
    14   )
    15   select t1.left, t1.right, t2.left, t2.right, t3.left, t3.right, t4.left, t
    4.right
    16     from t t1,
    17          t t2,
    18          t t3,
    19          t t4
    20    where t1.person = 2
    21      and t1.left = t2.person(+)
    22      and t2.left = t3.person(+)
    23*     and t3.left = t4.person(+)
    SQL> /
          LEFT      RIGHT       LEFT      RIGHT       LEFT      RIGHT       LEFT
         RIGHT
             4          5          8                     9         10Justin

  • Query for Software Updates Reports Install Date for only Some of the Installed Updates

    We use the following query to retrieve a list of software updates for a specific collection and software update group.  There are many cases where the installation status of a software update is 'installed' but there is no corresponding 'install
    date'.  Can anyone tell me why?
    declare   @AuthListLocalID as int
    declare @CollID as varchar(8)
    Select @CollID=CollectionID
    from v_Collection
    WHERE CollectionID='ZSV0000A'
    select @AuthListLocalID=CI_ID from   v_AuthListInfo
    where    CI_UniqueID='ScopeId_EAD5EB80-CC39-4EA2-B08F-A45BB84F1D76/AuthList_4DEAD110-5740-495E-8BD8-467A55C50A0C'
    select
    rs.Name0 as ServerName,
    catinfo.CategoryInstanceName as Vendor,
    catinfo2.CategoryInstanceName as   UpdateClassification,
    ui.BulletinID as BulletinID,
    ui.ArticleID as ArticleID,
    Case ui.Severity WHEN 10 THEN 'Critical' WHEN 8 THEN 'Important' ELSE LTRIM(ui.Severity) END as Rating,
    ui.Title as Title,            
    Targeted=(case when ctm.ResourceID is not   null then '*' else '' end),
    Installed=(case when css.Status=3 then   '*' else '' end),
    IsRequired=(case when css.Status=2 then   '*' else '' end),
    Deadline=cdl.Deadline,            
    CAST(CASE   IsNull(AddRem.InstallDate0,CAST('1/1/1900' as smalldatetime)) WHEN   CAST('1/1/1900' as smalldatetime) THEN AddRem64.InstallDate0 ELSE   AddRem.InstallDate0 END as Date) as 'Install Date',
    ui.InfoURL as InformationURL
    from v_UpdateComplianceStatus css
    inner join v_UpdateInfo ui on   ui.CI_ID=css.CI_ID
    inner join v_CIRelation cir 
    on ui.CI_ID=css.CI_ID and cir.ToCIID =   ui.CI_ID -- add this
    inner join v_CICategories_All catall on   catall.CI_ID=ui.CI_ID 
    inner join v_CategoryInfo catinfo on   catall.CategoryInstance_UniqueID = catinfo.CategoryInstance_UniqueID and   catinfo.CategoryTypeName='Company' 
    inner join v_CICategories_All catall2 on   catall2.CI_ID=ui.CI_ID 
    inner join v_CategoryInfo catinfo2 on   catall2.CategoryInstance_UniqueID = catinfo2.CategoryInstance_UniqueID
    and   catinfo2.CategoryTypeName='UpdateClassification'
    left outer join v_CITargetedMachines ctm   on ctm.CI_ID=css.CI_ID
    and ctm.ResourceID = css.ResourceID
    left outer join v_GS_ADD_REMOVE_PROGRAMS   AddRem on css.ResourceID = AddRem.ResourceID and ui.Title =   AddRem.DisplayName0
    left outer join   v_GS_ADD_REMOVE_PROGRAMS_64 AddRem64 on css.ResourceID = AddRem64.ResourceID   and ui.Title = AddRem64.DisplayName0
    left outer join (select atc.CI_ID
    ,CreationTime=min(a.CreationTime)
    ,ExpirationTime=min(a.ExpirationTime)
    ,StartTime=min(a.StartTime)
    ,EnforcementDeadLine=min(a.EnforcementDeadLine)
    ,LastModificationTime=min(a.LastModificationTime)
    ,Deadline=min(a.EnforcementDeadline)
    from v_CIAssignment a
    inner join v_CIAssignmentToCI atc on   atc.AssignmentID=a.AssignmentID
    group by atc.CI_ID) cdl  
    on cdl.CI_ID=css.CI_ID
    left outer join v_R_System rs ON   css.ResourceID=rs.ResourceID
    where    css.ResourceID in (
    Select vc.ResourceID
    FROM v_FullCollectionMembership vc
    WHERE vc.CollectionID=@CollID)
    and cir.FromCIID=@AuthListLocalID
    and cir.RelationType=1  
    order by
    catinfo.CategoryInstanceName
    , catinfo2.CategoryInstanceName
    , ui.ArticleID

    Hi Mate,
    Its really difficult to do get the installed date of the patches as there is no table available in SCCM  DB to pull this info i had a requirement in the past but i was unable to do had done it via work around.
    This can be done after editing of sms_def.mof file or else using the power-shell script in windows server 2008 where the powershell is a feature by default.
    H/W inventory: 
    For the 2000 servers this has to be installed but if we enable this its mentioned it may utilize upto 100 % of the Memory during the h/w inventory you can check that in your SMS_DEF.MOF  -
    QuickFixEngineering you can see the warning.uickFixEngineering
    http://support.microsoft.com/kb/279225/en-us
    Powershell script:
    http://msmvps.com/blogs/richardsiddaway/archive/2011/10/23/1760058.aspx
    the warning for the quick fix engineering is not there on 2012 but there on 2007 hope the info help you to achieve your output.
    Kamala kannan.c| Please remember to click “Mark as Answer” or Vote as Helpful if its helpful for you. |Disclaimer: This posting is provided with no warranties and confers no rights

  • Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs ?

    Hi all,
    Can I use Reports Server Queue PL/SQL Table API to retrieve past jobs using WEB.SHOW_DOCUMENT from Forms ?
    I have reviewed note 72531.1 about using this feature and wonder if i can use this metadata to retrieve past jobs submitted by a user.
    The idea would be to have a form module that can filter data from the rw_server_queue table, say, base on user running the form, and be able to retrieve past jobs from Report Server Queue. For this, one would query this table and use WEB.SHOW_DOCUMENT.
    Is this possible ...?
    Regards, Luis ...!

    Based on that metalink note and the code in the script rw_server.sql, I am pretty sure that by querying the table you would be able accomplish what you want... I have not tested it myself... but it looks that it will work... you have the jobid available from the queue, so you can use web.show_document to retrieve the output previously generated...
    ref:
    -- Constants for p_status_code and status_code in rw_server_queue table (same as zrcct_jstype)
    UNKNOWN CONSTANT NUMBER(2) := 0; -- no such job
    ENQUEUED CONSTANT NUMBER(2) := 1; -- job is waiting in queue
    OPENING CONSTANT NUMBER(2) := 2; -- opening report
    RUNNING CONSTANT NUMBER(2) := 3; -- running report
    FINISHED          CONSTANT NUMBER(2) := 4; -- job has finished
    TERMINATED_W_ERR CONSTANT NUMBER(2) := 5; -- job has terminated with

  • Running Mavericks OS on MacBookPro...had some hard crashes past 24 hours...now can't print in Office or Firefox.  Both crash during print dialog - changing printer.  Printed fine before.   Ideas?

    Running Mavericks OS on MacBookPro...had some hard crashes past 24 hours...forced reboots....now can't print anything from Office or Firefox.  Both crash during print dialog - changing printer causes instand crash.  My system printed fine before the crashes yesterday.  I can print from the Stickies app and safari printed fine.  I did a full Shutdown/restart and that didn't work.  Ideas on how to get PPT files to print again or print from firefox??

    Error log from PPT:
    Microsoft Error Reporting log version: 2.0
    Error Signature:
    Exception: EXC_BAD_ACCESS
    Date/Time: 2014-03-25 22:12:04 +0000
    Application Name: Microsoft PowerPoint
    Application Bundle ID: com.microsoft.Powerpoint
    Application Signature: PPT3
    Application Version: 14.3.9.131030
    Crashed Module Name: CoreFoundation
    Crashed Module Version: 855.14
    Crashed Module Offset: 0x00012192
    Blame Module Name: Microsoft PowerPoint
    Blame Module Version: 14.3.9.131030
    Blame Module Offset: 0x002a285e
    Application LCID: 1033
    Extra app info: Reg=en Loc=0x0409
    Crashed thread: 0

  • Display Current Time and past 3 hours

    Post Author: gronkette
    CA Forum: Formula
    I have a report that I need to display only the current hour and the past 3 hours rolling forward.
    Example:  If it is now 12:00 (noon)  I would like to see the data for 10:00, 11:00 and 12:00
    Then we it is 1:00 pm, I would like to see the date for 11:00, 12:00 and 1:00 - etc....
    thanks!
    Filed under: CRXI

    Post Author: SKodidine
    CA Forum: Formula
    The formula works just fine in my report, all I can say is make sure that the database field is DATETIME and that the values do indeed have date time.

  • Impact of hourly Data load on BW and R/3

    Hi...
    As of now, the delta load from R/3 to BW is taking place every night. But, the users claim that they need it hourly.
    Is this practice (hourly data load from r/3 to bw) is usually done? What would be the impact on BW and R/3? (any performance issues!)
    What is the minimum best time interval for the delta loads?
    Thanks,
    Sai.

    I think you have to let user business requirements dictate the answers as long as there are not any system or application constraints.
    We have a load that at run 4 times a day during a 9 hour window, once at the beginning to pickup any overnight work and then about every 3 hrs during the business day to pick up new information that is needed.
    No discernible impact on R3 here, but that probably depends on your transaction volume and efficiency of the extractors that are used.
    The user base does need to understand that loads will occur during the day and that depending on when the run a query, the results could change - but presumably that's the whole reason you are doing this in the first place.
    This does result in more Requests, so you want to make sure you are compressing your cubes based on the Request's age rather number of requests. 
    Can't really think of much else.

  • EJB Query Language where condtion based on date

    Hi,
    I am using EJB3 query language. In the table I have a column called requestdate which is in date time format. I have created an entity class.
    I need to select few records using query language(named queries) based on this requestdate matching to the current date. I want to compare only based on Date value (truncating the time). Something like this
    select max(o.req_id) from requests o where o.requestdate = :currentdate
    currentdate is java.sql.Date value formatted to yyyymmdd only.
    How can I do this using query language?
    Please help to me get this done.
    thanka
    Anuradha

    Hi Anuradha ,
    I'm afraid the query language does not support retrieving the date portion (i.e. truncating the time) from a date field.
    I propose you turn you named into a BETWEEN query taking two parameters one for the beginning of the day and another for the end of the day. Then your named query could look like:
    SELECT max(o.req_id) FROM requests o WHERE o.requestdate BETWEEN :start AND :end
    The following code creates two calendar instances for the current day, one for 00:00:00 and another for 23:59:59:
    Calendar start = Calendar.getInstance();
    start.set(Calendar.HOUR_OF_DAY, 0);
    start.set(Calendar.MINUTE, 0);
    start.set(Calendar.SECOND, 0);
    start.set(Calendar.MILLISECOND, 0);
    Calendar end = Calendar.getInstance();
    end.set(Calendar.HOUR_OF_DAY, 23);
    end.set(Calendar.MINUTE, 59);
    end.set(Calendar.SECOND, 59);
    end.set(Calendar.MILLISECOND, 999);
    Here is some sample code that creates a query instance for a named query called findMaxRequestPerDay and passes the Date of the above Calendar instance as actual parameter values. It assumes the named query is called findMaxRequestPerDay and the req_id field is a long:
    Query query = em.createNamedQuery("findMaxRequestPerDay");
    query.setParameter("start", start.getTime());
    query.setParameter("end", end.getTime());
    Long max = (Long)query.getSingleResult();
    I hope this helps.
    Regards Michael

  • Creating query results in a report without data

    Hi ABAP consultants,
    First of all I would like to explain you all I am not ABAPPER and this is the first time I work with ABAP Query (I just receive orders...).
    I need to do some reports about account receivables and I decided to work with the following tables: VBAK, VBAP, LIPS, LIKP, VBEP, VKDFS, VEPVG, VAPMA, KNB4.
    Despite there are information on those tables when I test the query SAP  retrieves that "There are no data selected". Why does that happen? Is there any logic that I disrespected?
    Thank you all and have a nice day.
    Naej

    Hi,
    check for contents in tables in tcode -se11 once u find the records try this one
    Ex:
    TABLES vbak.
    select * from vbak.
    write:vbak-vbeln.
    ENDSELECT.
    or
    tables vbak.
    data: t_vbak type table of vbak.
    select * from vbak into table t_vbak.
    loop at t_vbak into vbak.
    write:vbak-vbeln.
    endloop.

Maybe you are looking for