How to find leap year in sql query

How to find leap year in sql query

Select
CASE
  WHEN result = 0 THEN 'Leap_Year'
  WHEN result <> 0 THEN 'Not_A_Leap_Year'
END
From (Select mod((EXTRACT(YEAR FROM DATE '2013-08-24')), 4) result FROM DUAL);

Similar Messages

  • HOW TO FIND AND CORRECT THE SQL QUERY ERRORS ????

    Sometimes I get the errors while executing the sql queries.
    I just wanted to know about the various ways by which I can find the sql query errors .
    Any suggestions will be deeply appreciated.

    If you get the an error from SSMS and you can't comprehend it, you can google the error message and google would always lead you to the correction. Or you can post the error in this forum, people
    here are always kind and ready to help :).
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • How to find duplicate row in sql query?

    Hi All,
    Please solve my query, find duplicate row and how to count its. your suggestion would be greatly appreciated.

    You can use group by and having.
    SQL> WITH t
      2       AS (SELECT       LEVEL id
      3                 FROM   DUAL
      4           CONNECT BY   LEVEL <= 5
      5           UNION ALL
      6           SELECT       LEVEL + 2
      7                 FROM   DUAL
      8           CONNECT BY   LEVEL <= 3)
      9  SELECT   *
    10    FROM   t;
            ID
             1
             2
             3
             4
             5
             3
             4
             5
    8 rows selected.
    SQL> WITH t
      2       AS (SELECT       LEVEL id
      3                 FROM   DUAL
      4           CONNECT BY   LEVEL <= 5
      5           UNION ALL
      6           SELECT       LEVEL + 2
      7                 FROM   DUAL
      8           CONNECT BY   LEVEL <= 3)
      9  SELECT     id, COUNT (*)
    10      FROM   t
    11  GROUP BY   id
    12    HAVING   COUNT (*) > 1;
            ID   COUNT(*)
             3          2
             4          2
             5          2
    SQL>

  • How to Calculate Leap Year ago in OBIEE 11g

    Hi Gurus,
    I have one fact table and having one measure column. I have to calculate current year and Last year.
    Using Time series function (Todate,Ago) have calculated current year as well last year also.
    The problem is Current year is showing correct value only but Last year was showing wrong data.
    We found the problem is Leap year, last year FEB month is having 29 dates. Due to this we are getting wrong date.
    Kindly suggest me how to achieve this requirement.
    Thanks

    Hi Gurus,
    How to resolve Leap Year calculation in OBIEE 11g.
    The problems is Year Ago column.
    Please suggest me how to resolve this.
    Thanks

  • How to add a parameter to sql query in report

    Hi
    How to add a parameter to sql query in report.
    Parameter is from Visual studio
    example:
    select * from tab1 where dl=parameter???
    I have VS 2008 prof CR XI R2, mysql

    Hello,
    If you have this API available then you can modify the record selection formulae in code to add filtering:
              string recordSelectionFormula = "{T_INV_RPT_ADDR.IND_PROMUS} = {?P_PROMUS?} AND {T_INV_RPT_POINT.INVOICE_DATE} = DATE(2008, 05, 31) AND {T_INV_RPT_POINT.CHECKOUT_DATE} = date(2008, 04,29)";
                CrystalDecisions.CrystalReports.Engine.ReportDocument.RecordSelectionFormula = recordSelectionFormula;
    You have to format and follow the rules as in the Designer so not too much work to get this to work.
    CR for .NET may not have the ability so you will need to upgrade to a Developer version of Crystal Reports.
    Thank you
    Don

  • How to get this output using sql query?

    Hi,
      How to get this output using sql query?
    Sno Name Age ADD Result
    1 Anil 23 delhi Pass
    2 Shruti 25 bangalor Pass
    3 Arun 21 delhi fail
    4 Sonu 23 pune Pass
    5 Roji 26 hydrabad fail
    6 Anil 28 delhi pass
    Output
    Sno Name Age ADD Result
    1 Anil 23 delhi pass
    28 delhi pass

    Hi Vamshi,
    Your query is not pretty clear.
    write the select query using Name = 'ANIL' in where condition and display the ouput using Control-break statements.
    Regards,
    Kannan

  • How to hide repeated details using SQL Query?

    How to hide repeated details using SQL Query?
    For Ex:
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    10 | BLAKE | CLERK |
    10 | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    20 | ADAMS | CLERK |
    20 | KING | SALESMAN|
    ------------------------+
    How we can display the above details in the following way?
    ------------------------+
    DEPTNO| ENAME | JOB |
    ------|-------| --------|
    10 | JAMES | MANAGER |
    | BLAKE | CLERK |
    | FORD | SALESMAN|
    20 | SCOTT | MANAGER |
    | ADAMS | CLERK |
    | KING | SALESMAN|
    ------------------------+
    Thanks Advance

    Hi,
    you can use BREAK ON DEPTNO in SQL*Plus or use LAG.
    SQL> ed
    Wrote file afiedt.buf
      1  select nullif(department_id
      2                , lag(department_id) over (partition by department_id order by last_name)
      3         ) dept_id
      4  , last_name, job_id
      5*  from employees where department_id in (30,50) and rownum <=10
    SQL> /
       DEPT_ID LAST_NAME                 JOB_ID
            30 Baida                     PU_CLERK
               Colmenares                PU_CLERK
               Himuro                    PU_CLERK
               Khoo                      PU_CLERK
               Raphaely                  PU_MAN
               Tobias                    PU_CLERK
            50 Fripp                     ST_MAN
               Kaufling                  ST_MAN
               Vollman                   ST_MAN
               Weiss                     ST_MAN
    10 rows selected.

  • How to find the queryid of a query

    Hi,
    Can someone suggest how to find the queryid of a query?
    Many thanks,
    Xibi

    hi xibi
    please follow my simple way to find the queryid of the query.
    Go to open qeury from BEx, select the query for which you wish to see the queryid, copy the query using CtrlC and paste the same to notepad CtrlP.
    There you can see the queryid with all the other details also.
    The result you find with this method is the easiest i hope.
    hope this helps
    regards
    vijaykumar

  • HT4993 how to find my year of birth on the iphone4

    how to find my year of birth on the iphone4

    It sounds as if it wants the answer to your security question "what is the year of your birth".
    Apple has been using these security questions for a few months now. Presumably it is to avoid theft from people guessing other people's Apple IDs and passwords. No one knows why or when anyone is asked for the answers, and like any good security system it is designed to be unpredictable.
    Whatever you answered for that question, only you can know, that's the idea behind the security questions. You could have answered 1492, it really doesn't matter, as long as your answer matches what you originally supplied.
    If you are being locked out because your answer is not what it is expecting, your only recourse is to contact iTunes Support and ask them to reset your password. You will have to answer some questions to confirm you are who you say you are, and then they will send you an email with instructions to reset your password and create new answers to more security questions.
    Contact iTunes Support here: http://www.apple.com/emea/support/itunes/contact.html

  • How to Find the Year to Date ?

    Dear Experts
    How to find the Year to date in BI 7.0 i.e(1st April of Current year  to Tilldate) is there any Standard Variable is there ,Please let me know .as we are needed in our project.
    Thanks in Advance
    Satish

    Hi,
    I hope Stadard variables(Cumilated upto current fiscal year-0FYTCFP) will be avalable for this kind of requirement. Try to create a restricted key fig by make use of the standard variables...
    This is just my assumption.
    Message was edited by:
            Kameswari Ponnuri

  • How to find session information in sql plus

    Can someone please tell me how to find session information in sql plus? I specifically want to know my privileges for the current session. Thanks in advance.

    SELECT * FROM session_privs;
    SELECT * FROM session_roles;

  • How to find where the below sql is used in database

    Hi all,
    I am tring to find the below SQL in our data base where it is used?
    I had done the checking in all reports manually, But have no luck.
    But i am sure that the below sql is in our data base and having some issue on it.
    Can any one please let me know how to find where the below query is used in our database? I mean in packages/ triggers/ procedures or any where in our database
    Please find the query
    select count(sh.shipment_gid) from SHIPMENT sh, SHIPMENT_TYPE stp, LOCATION ld where (sh.shipment_gid in (select sstop.shipment_gid from SHIPMENT_STOP sstop where (sstop.appointment_delivery > trunc(TO_DATE(:1, :2), :3)) and (sstop.appointment_delivery is not null))) and (sh.is_to_be_held=:"SYS_B_0") and (sh.domain_name=:4) and (sh.insurance_policy_number like :"SYS_B_1") and (sh.perspective=:"SYS_B_2") and (sh.shipment_type_gid=stp.shipment_type_gid) and (sh.dest_location_gid=ld.location_gid(+)) and (stp.shipment_type_xid!=:5) order by ld.location_name, sh.start_time
    Regards,
    Dpk

    There is video demonstration how to import from data dictionary.
    After import you can select from the main menu: View->DDL File Editor menu item to open the DDL dialog and then click on "Generate" button on the dialog. When the DDL is generated you can search in it using "Find" button.
    Ivan

  • Urgent= How to Group selected columns in sql query

    Hi,
    I need some urgent help on the following sql query. I 'm sure there is an easy way to do this but I'm stacked!Any help will be much appreciated!!
    I have a query to retrieve the following columns:
    I want the first 9 columns to be grouped together (not to be repeated) for any occurence of the last 3 columns (abs.ABSENCE_START_DATE,abs.ABSENCE_END_DATE, abs.DAYS_TAKEN DAYS_TAKEN_analysis)
    SELECT DISTINCT
    sum.employee_number ,
    sum.EMPLOYEE_NAME,
    sum.EMAIL_ADDRESS,
    sum.ORGANIZATION ,
    sum.BCEBF ,
    sum.ALDE ,
    sum.CURYRREMDAYS ,
    sum.DAYS_TAKEN ,
    sum.REMBCE ,
    abs.ABSENCE_START_DATE
    abs.ABSENCE_END_DATE,
    abs.DAYS_TAKEN DAYS_TAKEN_analysis
    --TO_CHAR(TO_CHAR(abs.ABSENCE_START_DATE)||' '||TO_CHAR(abs.ABSENCE_END_DATE)||' '||TO_CHAR(abs.DAYS_TAKEN)) DAYS_TAKEN_ANAL
    FROM
    HB_V_ANNUAL_LEAVE_SUMMARY_REP SUM,
    HB_V_AN_LEAV_DAYS_TAKEN_REP ABS
    WHERE
    sum.employee_number = abs.EMPLOYEE_NUMBER
    ORDER BY
    sum.employee_number ,
    sum.EMPLOYEE_NAME,
    sum.EMAIL_ADDRESS,
    sum.ORGANIZATION ,
    sum.BCEBF ,
    sum.ALDE ,
    sum.CURYRREMDAYS ,
    sum.DAYS_TAKEN ,
    sum.REMBCE
    Any feedback/help on how to do this will be highly appreciated.
    Thanks a lot
    Elena

    Please help!!
    I used the break command to group columns that I do not want to repeat in my query output. When I run the query without formatting is working. But when I put all formatting to produce the required output I dont get the result I want.
    Below is the exact sql query I use:
    <<
    SET TERMOUT OFF
    SET ECHO OFF
    SET ARRAY 35
    SET HEA OFF
    SET FEEDBACK OFF
    SET PAGES 2000
    col beginLINE format A100
    col winsecidLINE format A100
    col placeLINE format A100
    COL LINEempty1 format A100
    COL LINEempty2 format A100
    COL LINEempty3 format A100
    COL LINEempty4 format A100
    COL LINEempty5 format A100
    COL LINEempty6 format A100
    COL LINEempty7 format A100
    COL LINEempty8 format A100
    COL LINEempty9 format A100
    COL LINEempty10 format A100
    col LINECOLempty format A100
    col receiverLINE FORMAT A100
    COL EMP_EMAIL_ADDRESS FORMAT A100
    COL LINEHEADER FORMAT A100
    COL unitsLINE FORMAT A100
    COL lmLINE FORMAT A100
    COL INTITLE FORMAT A100
    COL LINECOL1 FORMAT A100
    COL CIF FORMAT A100
    COL EMPLOYEE_NAME FORMAT A100
    COL ORGANIZATION FORMAT A100
    COL LINECOL2 FORMAT A100
    COL ALHEADER FORMAT A100
    col LINECOL3 FORMAT A100
    col BCEBF FORMAT A100
    col ALDE FORMAT A100
    COL CURYRREMDAYS FORMAT A100
    COL DAYS_TAKEN FORMAT A100
    col LINECOL4 FORMAT A100
    COL REMBCE FORMAT A100
    col LINECOL5 FORMAT A100
    col LINECOL6 FORMAT A100
    col ALHEADER2 FORMAT A100
    col LINECOL7 FORMAT A100
    col endLINE FORMAT A100
    break on beginLINE on winsecidLINE on placeLINE on LINEempty1 ON LINEempty2 ON LINEempty3 ON LINEempty4 ON LINEempty5 ON LINEempty6 ON LINEempty7 ON LINEempty8 ON LINEempty9 ON LINEempty10 on receiverLINE on EMP_EMAIL_ADDRESS on LINEHEADER on unitsLINE on lmLINE on INTITLE on LINECOL1 on CIF on EMPLOYEE_NAME on ORGANIZATION on LINECOL2 on ALHEADER on LINECOL3 on BCEBF on ALDE on CURYRREMDAYS on DAYS_TAKEN on LINECOL4 on REMBCE on LINECOL5 on LINECOL6 on ALHEADER2 on LINECOL7 ON LINEempty11 ON endREPORT on endLINE
    SPOOL C:\FORMATout.txt
    SELECT
    '{{begin}} '||chr(10) beginLINE,
    '{{winsecid 999999}} '||chr(10) winsecidLINE,
    '{{place rbsemail.tif 0 0}} '||chr(10) placeLINE,
    ' '||chr(10) LINEempty1,
    ' '||chr(10) LINEempty2,
    ' '||chr(10) LINEempty3,
    ' '||chr(10) LINEempty4,
    ' '||chr(10) LINEempty5,
    ' '||chr(10) LINEempty6,
    ' '||chr(10) LINEempty7,
    ' '||chr(10) LINEempty8,
    ' '||chr(10) LINEempty9,
    ' '||chr(10) LINEempty10,
    '{{from [email protected]}} '||chr(10) receiverLINE,
    '{{fax '|| EMAIL_ADDRESS||' }} '||chr(10) EMP_EMAIL_ADDRESS,
    '{{Subject Annual Leave Summary Report as at '||sysdate||' }} '||chr(10) LINEHEADER,
    '{{units cm}} '||chr(10) unitsLINE,
    '{{lm 2.0}} '||chr(10) lmLINE,
    'ANNUAL LEAVE SUMMARY REPORT AS AT '||sysdate INTITLE,
    '---------------------------------------------------------------------' LINECOL1,
    'CIF: '||CIF CIF,
    'EMPLOYEE NAME: '||EMPLOYEE_NAME EMPLOYEE_NAME,
    'DEPARTMENT DETAILS: '||ORGANIZATION ORGANIZATION,
    '---------------------------------------------------------------------' LINECOL2,
    'ANNUAL LEAVE DETAILS:' ALHEADER,
    '---------------------------------------------------------------------' LINECOL3,
    'BALANCE B/F FROM PREVIOUS YEAR: '||BCEBF BCEBF,
    'DAYS ENTITLED FOR THE CURRENT YEAR: '||ALDE ALDE,
    'CURRENT YEAR REMAINING DAYS: '||CURYRREMDAYS CURYRREMDAYS,
    'DAYS TAKEN FOR THE CURRENT YEAR: '||DAYS_TAKEN DAYS_TAKEN,
    '---------------------------------------------------------------------' LINECOL4,
    'REMAINING BALANCE: '||REMBCE REMBCE,
    '---------------------------------------------------------------------' LINECOL5,
    '---------------------------------------------------------------------' LINECOL6,
    'ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:' ALHEADER2,
    '---------------------------------------------------------------------' LINECOL7,
    TO_CHAR('START DATE: '||ABSENCE_START_DATE||' '||'END DATE: '||ABSENCE_END_DATE||' '||'DAYS TAKEN : '||DAYS_TAKEN_ANAL) AL_DAYS_ANAL,
    ' '||chr(10) LINEempty11,
    '-- End of Report -- '||chr(10) endREPORT,
    '{{end}} '||chr(10) endLINE
    FROM HB_V_AN_LEAV_SUM_DAYSTAKEN_REP
    WHERE CIF IN ('098033','098024')
    ORDER BY
    beginLINE ,
    winsecidLINE,
    placeLINE ,
    LINEempty1,
    LINEempty2,
    LINEempty3,
    LINEempty4,
    LINEempty5,
    LINEempty6,
    LINEempty7,
    LINEempty8,
    LINEempty9,
    LINEempty10,
    receiverLINE,
    EMP_EMAIL_ADDRESS,
    LINEHEADER ,
    unitsLINE ,
    lmLINE ,
    INTITLE ,
    LINECOL1,
    CIF ,
    EMPLOYEE_NAME ,
    ORGANIZATION ,
    LINECOL2 ,
    ALHEADER ,
    LINECOL3,
    BCEBF ,
    ALDE ,
    CURYRREMDAYS ,
    DAYS_TAKEN ,
    LINECOL4 ,
    REMBCE ,
    LINECOL5 ,
    LINECOL6 ,
    ALHEADER2 ,
    LINECOL7 ,
    LINEempty11,
    endREPORT,
    endLINE
    spool off
    >>
    The required output I want to get is:
    <<
    {{begin}}
    {{winsecid 750612}}
    {{place rbsemail.tif 0 0}}
    {{from [email protected]}}
    {{fax [email protected] }}
    {{Subject Annual Leave Summary Report as at 04-APR-08 }}
    {{units cm}}
    {{lm 2.0}}
    ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
    CIF: 098024
    EMPLOYEE NAME: Christou Christos Panteli
    DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
    ANNUAL LEAVE DETAILS:
    BALANCE B/F FROM PREVIOUS YEAR: 9
    DAYS ENTITLED FOR THE CURRENT YEAR: 27
    CURRENT YEAR REMAINING DAYS: 24
    DAYS TAKEN FOR THE CURRENT YEAR: -3
    REMAINING BALANCE: 33
    ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
    START DATE: 04-JAN-08 END DATE: 04-JAN-08 DAYS TAKEN : 1
    START DATE: 24-JAN-08 END DATE: 24-JAN-08 DAYS TAKEN : 1
    START DATE: 20-FEB-08 END DATE: 20-FEB-08 DAYS TAKEN : 1
    -- End of Report --
    {{end}}
    {{begin}}
    {{winsecid 750612}}
    {{place rbsemail.tif 0 0}}
    {{from [email protected]}}
    {{fax [email protected]}}
    {{Subject Annual Leave Summary Report as at 04-APR-08 }}
    {{units cm}}
    {{lm 2.0}}
    ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
    CIF: 098033
    EMPLOYEE NAME: Demetriou Elena Steliou
    DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
    ANNUAL LEAVE DETAILS:
    BALANCE B/F FROM PREVIOUS YEAR: 15
    DAYS ENTITLED FOR THE CURRENT YEAR: 27
    CURRENT YEAR REMAINING DAYS: 25
    DAYS TAKEN FOR THE CURRENT YEAR: -2
    REMAINING BALANCE: 40
    ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
    START DATE: 15-JAN-08 END DATE: 15-JAN-08 DAYS TAKEN : 1
    START DATE: 24-MAR-08 END DATE: 24-MAR-08 DAYS TAKEN : 1
    -- End of Report --
    {{end}}
    >>
    However the actual output we get from the above query is as follows:
    <<
    {{begin}}
    {{winsecid 750612}}
    {{place rbsemail.tif 0 0}}
    {{from [email protected]}}
    {{fax [email protected] }}
    {{Subject Annual Leave Summary Report as at 04-APR-08 }}
    {{units cm}}
    {{lm 2.0}}
    ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
    CIF: 098024
    EMPLOYEE NAME: Christou Christos Panteli
    DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
    ANNUAL LEAVE DETAILS:
    BALANCE B/F FROM PREVIOUS YEAR: 9
    DAYS ENTITLED FOR THE CURRENT YEAR: 27
    CURRENT YEAR REMAINING DAYS: 24
    DAYS TAKEN FOR THE CURRENT YEAR: -3
    REMAINING BALANCE: 33
    ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
    START DATE: 04-JAN-08 END DATE: 04-JAN-08 DAYS TAKEN : 1
    -- End of Report --
    {{end}}
    START DATE: 24-JAN-08 END DATE: 24-JAN-08 DAYS TAKEN : 1
    START DATE: 20-FEB-08 END DATE: 20-FEB-08 DAYS TAKEN : 1
    {{fax [email protected] }}
    {{Subject Annual Leave Summary Report as at 04-APR-08 }}
    {{units cm}}
    {{lm 2.0}}
    ANNUAL LEAVE SUMMARY REPORT AS AT 04-APR-08
    CIF: 098033
    EMPLOYEE NAME: Demetriou Elena Steliou
    DEPARTMENT DETAILS: 003-031-010-314-03140-Special Projects
    ANNUAL LEAVE DETAILS:
    BALANCE B/F FROM PREVIOUS YEAR: 15
    DAYS ENTITLED FOR THE CURRENT YEAR: 27
    CURRENT YEAR REMAINING DAYS: 25
    DAYS TAKEN FOR THE CURRENT YEAR: -2
    REMAINING BALANCE: 40
    ANNUAL LEAVE DAYS TAKEN ANALYSIS FOR THE CURRENT YEAR:
    START DATE: 15-JAN-08 END DATE: 15-JAN-08 DAYS TAKEN : 1
    -- End of Report --
    {{end}}
    START DATE: 24-MAR-08 END DATE: 24-MAR-08 DAYS TAKEN : 1
    >>
    IF ANYONE CAN HELP ON THIS I WOULD REALLY APPRECIATE IT!
    THANKS A LOT!
    Best regards,
    Elena

  • How to measure the performance of sql query?

    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i...
    It ll be useful for me to write efficient query....
    Thanks & Regards

    psram wrote:
    Hi Experts,
    How to measure the performance, efficiency and cpu cost of a sql query?
    What are all the measures available for an sql query?
    How to identify i am writing optimal query?
    I am using Oracle 9i... You might want to start with a feature of SQL*Plus: The AUTOTRACE (TRACEONLY) option which executes your statement, fetches all records (if there is something to fetch) and shows you some basic statistics information, which include the number of logical I/Os performed, number of sorts etc.
    This gives you an indication of the effectiveness of your statement, so that can check how many logical I/Os (and physical reads) had to be performed.
    Note however that there are more things to consider, as you've already mentioned: The CPU bit is not included in these statistics, and the work performed by SQL workareas (e.g. by hash joins) is also credited only very limited (number of sorts), but e.g. it doesn't cover any writes to temporary segments due to sort or hash operations spilling to disk etc.
    You can use the following approach to get a deeper understanding of the operations performed by each row source:
    alter session set statistics_level=all;
    alter session set timed_statistics = true;
    select /* findme */ ... <your query here>
    SELECT
             SUBSTR(LPAD(' ',DEPTH - 1)||OPERATION||' '||OBJECT_NAME,1,40) OPERATION,
             OBJECT_NAME,
             CARDINALITY,
             LAST_OUTPUT_ROWS,
             LAST_CR_BUFFER_GETS,
             LAST_DISK_READS,
             LAST_DISK_WRITES,
    FROM     V$SQL_PLAN_STATISTICS_ALL P,
             (SELECT *
              FROM   (SELECT   *
                      FROM     V$SQL
                      WHERE    SQL_TEXT LIKE '%findme%'
                               AND SQL_TEXT NOT LIKE '%V$SQL%'
                               AND PARSING_USER_ID = SYS_CONTEXT('USERENV','CURRENT_USERID')
                      ORDER BY LAST_LOAD_TIME DESC)
              WHERE  ROWNUM < 2) S
    WHERE    S.HASH_VALUE = P.HASH_VALUE
             AND S.CHILD_NUMBER = P.CHILD_NUMBER
    ORDER BY ID
    /Check the V$SQL_PLAN_STATISTICS_ALL view for more statistics available. In 10g there is a convenient function DBMS_XPLAN.DISPLAY_CURSOR which can show this information with a single call, but in 9i you need to do it yourself.
    Note that "statistics_level=all" adds a significant overhead to the processing, so use with care and only when required:
    http://jonathanlewis.wordpress.com/2007/11/25/gather_plan_statistics/
    http://jonathanlewis.wordpress.com/2007/04/26/heisenberg/
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • How to find out who installed SQL Server in Big orgnization?

    Hi all,,,
    I want to find out who installed SQL server in their computers/servers. The internet is open and it's easy to install SQL server EXPRESS. Iam not looking for the command which will results computers in my vlan only. Iam looking for a query to result out
    all SQL installed with different Vlan within the organization.
    Anyway to find them out?!  Thanks.

    No need to know WHO install it but is it possible to know the Host name that SQL installed in?!
    You asked for "who", not for "where".
    You can use MS MAP =
    Microsoft Assessment and Planning Toolkit : "Software Usage Tracker Feature Overview ....
    SQL Server" to get reports, which software is running on which machine.
    Or you can use this PowerShell Script
    Create Inventory of SQL Server in Network as Html
    For both you need permissions to fetch the required information from all machines, of course.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

Maybe you are looking for

  • Bursting using a Concatenated Data Source

    Greetings, I am trying to burst a report using a concatenated data source. I have a bursting SQL query set up that works fine, but I am unsure how to handle the "Split By" option. I have a data model that pulls data from multiple queries, like this:

  • NWBC - hiding/greying out buttons and OBN errors

    Hi, I'm working with Environment, Health & Safety via NWBC, but having great trouble influencing the NWBC screens. I am backend security proficient enough, however I cannot seems to figure out how the buttons on the NWBC side are controlled, hidden o

  • Messages Issue Across Phone and Macs

    iPhone 5 running 8.1.1 iMessage is set to be sent to iPad, 2 iMacs and 1 Macbook air and able to send as SMS All computers up and running the latest update of Yosemite at 10.10.1 iMac  - mid 2007, everything works fine between phone and computer Macb

  • Receiving payments from friends

    I created an account with the sole purpose of receiving payments from friends to pay me back when I make a payment on everyones behalf for a soccer club our kids are in.  I do not ever want to receive payments for goods or services on this new accoun

  • How to refresh the updated R/3 Hierarchy in BW

    Hi Guys, Could you please let me know the generic procedure about updating the R/3 hierarchy in BW? Regards, Sagar