What is the sql query for the real time reports Resource Stats?

Does anyone know what the query is that the real time report tool uses for the Resource Stats page?  Trying to develop a custom report that displays similar information that is updated regularly.

Hi,
009 wrote:
Hi Frank,
Just wanted your opinion on the above given SQLI'm not sure I understand it.
I added some more formatting to help me read it:
SELECT      A
,     CASE WHEN LAG(A,1) OVER (ORDER BY A) IS NULL
          OR A=LAG(A,1) OVER (ORDER BY A)
          THEN LAG(B,1) OVER (ORDER BY A)
     END B_LAG
,     B
FROM     (
     SELECT A, B
     FROM
          SELECT '1'A,'Apple' B FROM DUAL UNION ALL
          SELECT '1'A,'cat'B FROM DUAL UNION ALL
          SELECT '2'A,'bat'B FROM DUAL UNION ALL
          SELECT '3'A,'rat'B FROM DUAL UNION ALL
          SELECT '2'A,'yellow'B FROM DUAL UNION ALL
          SELECT '1'A,'pin'B FROM DUAL
     CONNECT BY PRIOR A=B
     ORDER BY A
);What is the purpose of the CONNECT BY in what you have so far?
Is the idea that you will add another CONNECT BY query, using
CONNECT BY  b_lag  = PRIOR b?
Do you think that will be better than using ROW_NUMBER?
Will it work if (a, b) is not unique?

Similar Messages

  • Extracting the Logical sql query for the specified report  in OBIEE 11g

    Hi ,
    I want to extract the logical SQL Query for the Particular report in OBIEE 11.1.1.5.
    Any pointers related to this will be very helpful.
    Thanks,
    Sonali

    for a try please add Logical sql view to ur report it will dispaly the Logical sql for that Report..
    Hope it will helps you.

  • Find out the sql query for special characters.

    Hi,
    I have the emp table with column name first_name.In that table i have lot records with first_name inlcudes the below mentioned special characters.
    ¡ , ¿, ,Ä,Å,ä,ª,À,Á,Ã,à,á,ã,å,Æ,æ,Ç,ç,È,É,Ê,Ë,è,é,ê,ë,Ì,Í,Î, Ï,ì,í,î,ï, Ñ,ñ, ô, º, Ò, Ó, Ô, Õ, Ö, Ø, ò, ó, õ, ö, ø, ß, Û, Ù, Ú, Ü,ù, ú, û, ü, ÿ,
    I am looking for the records with includes the above mentioned special characters in the first_name column.
    Can u please give the sql query to find out the records.
    Thanks&Regards
    N.Sivaraman

    I am looking for the records with includes the above mentioned special characters in the first_name column.One way would be:
    select emp.*
      from emp,
           table (
             sys.odcivarchar2list ('¡',
                                   'Ä',
                                   'Å',
                                   'ä',
                                   'ª',
                                   'À',
                                   'Á',
                                   'Ã',
                                   'à',
                                   'á',
                                   'ã',
                                   'å',
                                   'Æ',
                                   'æ',
                                   'Ç',
                                   'ç',
                                   'È',
                                   'É',
                                   'Ê',
                                   'Ë',
                                   'è',
                                   'é',
                                   'ê',
                                   'ë',
                                   'Ì',
                                   'Í',
                                   'Î',
                                   'Ï',
                                   'ì',
                                   'í',
                                   'î',
                                   'ï',
                                   'Ñ',
                                   'ñ',
                                   'ô',
                                   'º',
                                   'Ò',
                                   'Ó',
                                   'Ô',
                                   'Õ',
                                   'Ö',
                                   'Ø',
                                   'ò',
                                   'ó',
                                   'õ',
                                   'ö',
                                   'ø',
                                   'ß',
                                   'Û',
                                   'Ù',
                                   'Ú',
                                   'Ü',
                                   'ù',
                                   'ú',
                                   'û',
                                   'ü',
                                   'ÿ'
    where instr (ename, column_value) > 0

  • What can be the SQL Query for this requirement ?

    Hi,
    I have a table with fields like this:
    ID DESC PARENT
    01 ABC 02
    02 ABC1 01
    03 ABC2 01
    04 ABC4 02
    In the above table PARENT column refers to ID column , but actually in SQL query i want to have ID, DESC , and PARENTDESC (i.e., desc value of the corresponding ID)
    Actual output that i need is
    select ID , DESC , ?? from table where ID=someValue . Now if i provide ID=01 then output should be like this:
    ID DESC PARDESC
    01 ABC ABC1
    Can anyone help what can be the required sql query ?
    Edited by: bootstrap on Apr 29, 2011 6:15 AM

    SELECT T1.ID, T1.DESC, T2.DESC
    FROM TABLEA T1, TABLEA T2
    WHERE T1.ID='01'
    AND T2.ID = T1.PARENT;

  • HT1553 What is the best system for a real time cloud back up of documents?  My MacBook crashed, and I lost 2 hours of writing and could not find a way to restore it.

    My MacBook Pro crashed while I was rewriting a book, lost more than an hour of work and could not find a way to restore it.  Did not have Time Machine set up, but it appears that Time Machine does not have Real Time back up and documents must be manually stored.
    I need an automatic, real time back up to keep this from happening - I'm not happy my MacBook has crashed twice now.   What is the best cloud system for Real Time backup?   Thanks to anyone who can help me, I'm not the most astutde computer guy... James

    One way would be to use Dropbox, or a similar sync service, and just keep your critical documents in the appropriate folder. Dropbox, at least, keeps a local copy of everything and syncs automatically to the cloud whenver a change is made. Dropbox is free for up to 2GB of data.
    There are also true backup services such as CrashPlan+:
    http://www.crashplan.com/consumer/crashplan-plus.html
    which provide automatic backups whenver a change is detected. It's not free, but usually such services aren't too expensive unless you need to back up a lot of data.
    Regards.

  • SQL query for the following reqd.

    Hello Everyone,
    Say I have a table department with the following structure:
    DEPTID NAME PARENT_DEP
    1020 Corp Client
    2020 Corp Sales 1020
    2030 Corp Sales1 1020
    3010 Mkt and sales
    4010 Corp G & A Acct 2020
    5010 Finance and Mkt 3010
    What we find here is that department 4010 has its parent as 2020 and department 2020 has parent as 1020. The department 1020 is the root department which doesnot have any parent so its parent_dep value is NULL.
    I want to write a SQL statement, which will list all the records starting from the child record 4010 and tracing back to list its parent record and so on till the root record is reached. The result should look like this(neednot be in this order as shown below)
    DEPTID NAME PARENT_DEP
    1020 Corp Client
    2020 Corp Sales 1020
    4010 Corp G & A Acct 2020
    Can this be done using a single query.. if so can anyone help me ..... I want this to be done in SQL not in PLSQL.
    Thanks
    null

    select deptid, dname, p_dno from dept
    start with deptid=4010
    connect by deptid = prior p_dno
    order by level desc
    Hope this helps...

  • Need the sql query for IN clause.

    Hi All,
    i have item data like --
    IBM 200 and IBM 500
    have present code like this ----select * from emp where in (IBM 200 and IBM 500);
    so i need change or repalce like ('IBM 200','IBM 500')
    Any body please help me out this..
    Need to get out put 'IBM 200','IBM 500' from data IBM 200 and IBM 500 ...
    Edited by: anbarasan on Oct 17, 2011 10:30 PM

    Please consider the following when you post a question. This would help us help you better
    1. New features keep coming in every oracle version so please provide Your Oracle DB Version to get the best possible answer.
    You can use the following query and do a copy past of the output.
    select * from v$version 2. This forum has a very good Search Feature. Please use that before posting your question. Because for most of the questions
    that are asked the answer is already there.
    3. We dont know your DB structure or How your Data is. So you need to let us know. The best way would be to give some sample data like this.
    I have the following table called sales
    with sales
    as
          select 1 sales_id, 1 prod_id, 1001 inv_num, 120 qty from dual
          union all
          select 2 sales_id, 1 prod_id, 1002 inv_num, 25 qty from dual
    select *
      from sales 4. Rather than telling what you want in words its more easier when you give your expected output.
    For example in the above sales table, I want to know the total quantity and number of invoice for each product.
    The output should look like this
    Prod_id   sum_qty   count_inv
    1         145       2 5. When ever you get an error message post the entire error message. With the Error Number, The message and the Line number.
    6. Next thing is a very important thing to remember. Please post only well formatted code. Unformatted code is very hard to read.
    Your code format gets lost when you post it in the Oracle Forum. So in order to preserve it you need to
    use the {noformat}{noformat} tags.
    The usage of the tag is like this.
    <place your code here>\
    7. If you are posting a *Performance Related Question*. Please read
       {thread:id=501834} and {thread:id=863295}.
       Following those guide will be very helpful.
    8. Please keep in mind that this is a public forum. Here No question is URGENT.
       So use of words like *URGENT* or *ASAP* (As Soon As Possible) are considered to be rude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Show the SQL query on the report itself

    I'd like to show the entire SQL query in print at the end of a report, say in the Report Footer section so that the user could review it let me know what edits are needed to meet their needs.  Thanks

    Since the query itself doesn't really change (except for parameter values passed to selection criteria), you can just open the Show SQL Query and paste it into a text box.
    Beyond that, there isn't a way to add via a "Special Field".
    HTH,
    Jason

  • How do I change the underlying query for the task board (and backlog board) on TFS Preview

    All,
    We work with multi-area projects, each area representing a significant component within the project with its own release/iteration cycle. i.e. Several areas may be active at once, each with different iterations.
    When we look at the task board these take no account of the area being worked on. What I need to do is to be able to change the query behind these boards to point to a particular release/iteration for a particular area.
    Unfortunately there is no drop down selection on these pages to see this automatically so I need to be able to change the underlying query that populates these boards to get the the area and release/iteration that I need.... but I can't find where these
    are.
    Using multiple areas is actually highly frustrating with TFS Preview as it doesn't seem geared up at all to make it easy to switch between them... are we doing something wrong?
    I think I can do this by changing the current iteration - but I can't work out how to do this either once an iteration for a particular area has started.
    Can anybody help?
    Thanks

    It is not possible to modify the query behind the task board. If I understand you correctly, you would like to filter the task board by area path.
    In TFS 2012 we have repurposed the area path field to be the field that determines the team you are working on. We are continuously improving our product and being able to filter your task is one of the improvements that we are thinking of.
    Sorry I can't help you better than this for the moment.
    Please remember to mark the replies as answers if they help.
    Hi Ewald,
    We have a similar problem, see the thread "Best approach for multi-team/multi-projects." on this forum. I'm hopping you can help, since so far the different answers doesn't help.
    Best Regards,
    SYSOTI

  • Please help me with the proper query for the below problem

    Hi,
    I have a table RATE which have two columns RT_DATE (date) and RATES(number).
    This table have following data.
    RT_DATE
    RATES
    1-JAN-2007
    7
    2-MAR-2008
    7.25
    5-JAN-2009
    8
    8-NOV-2009
    8.5
    9-JUN-2010
    9
    I wanted to get the rate of interest on 8-DEC-2009.
    Output will be 8.5 as this given date is in between 8-NOV-2009 and 9-JUN-2010. Could you please help me with proper query?
    Regards,
    Aparna S

    Hi,
    That sounds like a job for the LAST function:
    SELECT  MIN (rates) KEEP (DENSE_RANK LAST ORDER BY rt_date) AS eff_rate
    FROM    rate
    WHERE   rt_date < 1 + DATE '2009-12-08'
    MIN above means that, in case of a tie (that is, 2 or more rows with the exact same latest rt_date) the lowest rates from that latest rt_date will be returned.  In rt_date is unique, then it doesn't matter if you use MIN or MAX, but syntax demands that you use some aggregate function there.
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for your sample data, and also post the results you want from that data.
    Point out where the statement above is getting the wrong results, and explain, using specific examples, how you get the right results from the given data in those places.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002#9362002

  • When I run the same query for the second time it's faster, I want to reset this behavior

    I am running a query in oracle 11g select A from B where C = ':D' B has millions of records.
    The first time i run it it takes about 30 seconds, the second time i run the query it takes about 1 second.
    Obviously it's caching something and i want it to stop that, each time i run the query i want it to take 30s - just like it was running for the first time.
    The reason I want to reset this is because for testing purposes I want to measure this query at the very first time.
    Please help.
    Thanks & Best Regards,
    Dark

    user9359353 wrote:
    I am running a query in oracle 11g select A from B where C = ':D' B has millions of records.
    The first time i run it it takes about 30 seconds, the second time i run the query it takes about 1 second.
    Obviously it's caching something and i want it to stop that, each time i run the query i want it to take 30s - just like it was running for the first time.
    The reason I want to reset this is because for testing purposes I want to measure this query at the very first time.
    Please help.
    Thanks & Best Regards,
    Dark
    No - you do NOT want to do that. Not if you want to get results that really represent how that query will work in reality.
    See these two AskTom blogs where he discusses the reasons for NOT doing this in detail.
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7413988573867
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:311990400346061304

  • Displaying the SQL Query in the report

    How can i display the query used to display a report..
    My query to get the records is as below
    select ename,empno from emp
    where deptno = :p_dept
    When i run the report i want to display the select statement as a message....
    How can we do this?

    One way is to create a column formula which you specifically redefine your query in. However, if you change your query you will need to also change your column formula. So this way could be prone to a mismatch of data. Unfortunately, I don't know of any better way. Hopefully someone else can suggest a better method. Good luck.

  • What is the sql query for this

    table Employee
    EmpId
    Name
    MonthlySalary
    DateofJoining
    Suggest  a sql server query to find out the employee details whose having salary greater than their yers of experiance 
    nravhad

    Hi ,
      As this seems to be a kind of lab exercise question for learning purpose , i am giving you the pseudo code which will help to solve this problem and learn.
      select <the requeired columns> from employee table.
      where Find the no of years between dateofjoining and current date using DATEDIFF function< monthly salary
      if this is not a lab exercise problem for learning purpose , please forgive my ignorance.
    Best Regards Sorna

  • How to write the SQL query for generating triangular numbers

    Hi,
    I have a table ..which stores the sequence number like this
    Seq :
    1000
    1200
    1300
    1500
    1800
    1900
    Now i want to get a result like this
    1000 1000
    1200 2200
    1300 3500
    1500 5000
    1800 6800
    1900 8700
    how can it be achieved. I tried using Lead and lag. but only I can add the n+1 or n-1 results. Please help.

    I've never heard it called 'triangular numbers' before but I think you're looking for a 'running total':
    SQL> WITH data AS
      2  (
      3     SELECT 1000 AS num FROM dual UNION ALL
      4     SELECT 1200 AS num FROM dual UNION ALL
      5     SELECT 1300 AS num FROM dual UNION ALL
      6     SELECT 1500 AS num FROM dual UNION ALL
      7     SELECT 1800 AS num FROM dual UNION ALL
      8     SELECT 1900 AS num FROM dual
      9  )
    10  /* END SAMPLE DATA */
    11  SELECT num, SUM(num) OVER (ORDER BY num) AS running_total
    12  FROM   data
    13  ORDER BY 1
    14  ;
           NUM RUNNING_TOTAL
          1000          1000
          1200          2200
          1300          3500
          1500          5000
          1800          6800
          1900          8700
    6 rows selected.

  • Please do write sql query for the output in the format

    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO MAXIMUM_SAL
    7369 SMITH CLERK 7902 17-DEC-80 800 20 3000
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30 3000
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30 3000
    7566 JONES MANAGER 7839 02-APR-81 2975 20 3000
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30 3000
    maximun salary of the all the employees should be displayed for each row of a employee record.

    WITH L AS (
    SELECT 100 EMPNO, 'RAJESH'  ENAME, 1000 SAL FROM DUAL
    UNION
    SELECT 200 EMPNO, 'VIJAYA'  ENAME, 4000 SAL FROM DUAL
    UNION
    SELECT 300 EMPNO, 'KUMAR'  ENAME, 1200 SAL FROM DUAL
    UNION
    SELECT 400 EMPNO, 'HARI'  ENAME, 100 SAL FROM DUAL
    SELECT empno,  ENAME, SAL, MAX(SAL) OVER()  FROM L;
    EMPNO                  ENAME  SAL                    MAX(SAL)OVER()        
    100                    RAJESH 1000                   4000                  
    200                    VIJAYA 4000                   4000                  
    300                    KUMAR  1200                   4000                  
    400                    HARI   100                    4000                  

Maybe you are looking for

  • Multiple issues with iBook G3

    I have three accounts and have multiple questions. I have iTunes and iPhotos both set to share libraries and nothing happens. Two of us cannot listen to iTunes saved by one account, nor can we see photos one users saved. Also, with one account, every

  • How to downgrade from Internet explorer 11 to internet explorer 10 on windows server 2008 R2

    Hi, Can someone please let me know how I can downgrade from IE11 to IE10 in my windows server 2008 R2. When I go to control Panel -> Programs -> features and I don't see any program name with internet explorer in that list. Also, when I go to on 'Vie

  • Problems with touch keyboard after ios6 update.

    After the ios6 update, my touch keyboard doesn't work well with certain apps. For example, in pages and Facebook it doesn't push up to reveal the typable area so I can't see what I'm typing. In numbers, I know longer see the old typable area right ab

  • AC_FL_RunContent: 'noborder' setting

    Hi, I'm using Flash 4 (just making a few simple Flash animations) and AC_RunActiveContent.js. When I use 100% (of a DIV, not of the screen) instead of 900px I can see the objects outside the animation (which is 900px to 217px). So I inserted AC_FL_Ru

  • Problem with SAP Logon

    Hi alls, I hope can some help me, I'm trying to connect to SAP via SAPLogon. I've tried to fix the problem but I don’t have success. SAP Logon Properties: Description:  NSP Application Server: localhost SAProuter-String: blank System-ID:        NSP S