I need to Tune Query.

Hi Team,
could you please tell me how to tune the below query.
UPDATE OBSERVATION_T
SET     OBS_NOOBSDOC=
                SELECT  COUNT(*)
                FROM    OBSERVATION_DOC_T od
                WHERE   od.SEQ_NO_OBS            =:1
                        AND od.OBS_SEVERITY NOT IN('K','X')
        UPD_DATE    =:2          ,
        VERSION_NO  =VERSION_NO+1,
        OBS_SEVERITY=:3          ,
        OBS_CORRSTAT=:4          ,
        OBS_MESSAGE =:5
WHERE   SEQ_NO_OBS  =:6

Please post the explain plain for your query .

Similar Messages

  • Do I need to tune the base query of my materialized view ?

    Hi gurus,
    We implement materialized view (FAST REFRESH ON COMMIT) on base table used in OLTP system. In fact the MV itself is also queried by the OLTP system itself, interactively.
    Currently user complain that after they input transaction, they see that the MV is not refresh as soon as they commit the transaction.
    (it takes 5 to 10 minutes before they see the update on the MV)
    The query of the MV is attached below, it consists of union all of two queries but actually the real query has 13 queries on a UNION ALL.
    The question is :
    Do I need to tune the query that forms the MV ?
    Does it impact the refresh time of the MV ?
    Thank you for your help,
    xtanto
    SELECT GRNH.DOC_CODE ||' '|| GRNH.GRN_NO, GRNH.GRN_DATE, GRNH.REGS_CODE,
    F_Convert_Qty_K(GRND.PRODUCT, GRND.QTY, GRND.UOM) QTY_IN, 0 QTY_OUT, 0 QTY_ADJ, 'N/A'.....
    FROM GRN_LOCAL_D GRND
              JOIN GRN_LOCAL_H GRNH ON GRNH.GRNH_ID = GRND.GRNH_ID
              WHERE GRND.PRODUCT IS NOT NULL AND GRNH.WH_CODE IS NOT NULL
    UNION ALL
    SELECT GRNH.DOC_CODE ||' '|| GRNH.GRN_NO, GRNH.GRN_DATE, GRNH.REGS_CODE,
    F_Convert_Qty_K(GRND.PRODUCT_B, GRND.QTY_B, GRND.UOM_B) QTY_IN, 0 QTY_OUT, 0 QTY_ADJ, 'N/A'...
    FROM GRN_LOCAL_D GRND
    JOIN GRN_LOCAL_H GRNH ON GRNH.GRNH_ID = GRND.GRNH_ID
    WHERE GRND.PRODUCT_B IS NOT NULL AND GRNH.WH_CODE IS NOT NULL
    UNION ALL
         ......

    Hi Justin & APC,
    Are they seeing a 5-10 minute delay in being able to commit their transaction?NO, the commit itself is completed normally, but after that when they go to the page (this is webbased app) that display data from the MV, the newly committed transactionis not there yet. Only after 5-10 minutes we can see the new data.
    What does the F_Convert_Qty_K() function do?It is a function that convert the quantity from whatever Unit Of Measurement (UOM) into the smallest UOM. Below is the code.
    So the question remains:
    why intermittently theere is delay before the new data visible in the MV ?
    Thanks you,
    xtanto
    CREATE OR REPLACE FUNCTION F_Convert_Qty (pProduct VARCHAR2, pQty NUMBER, pUOM VARCHAR2)
    RETURN NUMBER
    IS
    vQtyBase NUMBER(13,5);
    BEGIN
    SELECT CASE WHEN pUOM = ( SELECT UOM_BASE FROM PRODUCTS WHERE PRODUCT = pProduct)
              THEN pQty
         ELSE
                   SELECT ROUND(pQty * Coefficient / Divisor, 5)
                   FROM (
                             SELECT Coefficient, Divisor FROM CONVERT_UOM
                             WHERE PRODUCT = pProduct AND UOM_CONVERT = pUOM
                             ) tmp
              END INTO vQtyBase FROM DUAL;
    --RETURN (vQtyBase) ;
    RETURN ( NVL(vQtyBase,0) ) ;
    END F_Convert_Qty;
    /

  • Need to tune insert query

    Hi,
    I'm using below query inside the procedure.I need to tune this query as it is taking more time for execution.Could you some help on this
    *version.*
    10.2.0
    Query
    INSERT INTO  TEMP_TEST_STAT(
                SELECT S.STUDENT_ID_PK, A.RESPONSE_KEY GENDER, B.RESPONSE_KEY ETHNICITY, T.SCORE SCALE_SCORE ,D.TEST_NAME
                FROM TEST_SESSION_DETAIL T, TEST_SESSION S, STUDENT U, TEST_DETAIL D,
                SELECT I.ITEM_ID, I.UIN, BG.BG_SESSION_DETAIL_ID, BG.RESPONSE_KEY , B.TEST_SESSION_ID, C.STUDENT_ID_PK
                FROM BG_QUESTION_USER_RESPONSE BG, ITEM I, BG_SESSION_DETAIL B, TEST_SESSION C
                WHERE
                BG.ITEM_ID = I.ITEM_ID AND I.UIN = 'SBG002' AND
                BG.BG_SESSION_DETAIL_ID = B.BG_SESSION_DETAIL_ID
                AND B.TEST_SESSION_ID = C.TEST_SESSION_ID ) A,
                SELECT I.ITEM_ID, I.UIN, BG.BG_SESSION_DETAIL_ID, BG.RESPONSE_KEY , B.TEST_SESSION_ID, C.STUDENT_ID_PK
                FROM BG_QUESTION_USER_RESPONSE BG, ITEM I, BG_SESSION_DETAIL B, TEST_SESSION C
                WHERE
                BG.ITEM_ID = I.ITEM_ID AND I.UIN = 'SBG001' AND
                BG.BG_SESSION_DETAIL_ID = B.BG_SESSION_DETAIL_ID
                AND B.TEST_SESSION_ID = C.TEST_SESSION_ID ) B
                ,INSTITUTION E
                WHERE
                D.TEST_NAME = 'Reading Comprehension' AND
                T.TEST_SESSION_STATUS_ID = 3
                AND TRUNC(T.TEST_END_DATE) BETWEEN TO_DATE('01-09-09','DD-MON-YY') AND TO_DATE('30-09-09','DD-MON-YY')
                AND T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
                AND S.STUDENT_ID_PK = U.STUDENT_ID_PK
                AND S.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND A.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND A.STUDENT_ID_PK = S.STUDENT_ID_PK
                AND B.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND B.STUDENT_ID_PK = S.STUDENT_ID_PK
                AND S.INSTITUTION_ID=E.INSTITUTION_ID
                AND SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3) <> '000');
    Explain plan
    PLAN_TABLE_OUTPUT
    Plan hash value: 790379856
    | Id  | Operation                                      | Name                         | Rows  | Bytes | Cost (%CPU)| Time     | Pstart| Pstop |
    |   0 | INSERT STATEMENT                               |                              |     1 |   204 |  1567   (1)| 00:00:19 |       |       |
    |*  1 |  FILTER                                        |                              |       |       |            |          |       |       |
    |   2 |   NESTED LOOPS                                 |                              |     1 |   204 |  1567   (1)| 00:00:19 |       |       |
    |   3 |    NESTED LOOPS                                |                              |     1 |   189 |  1566   (1)| 00:00:19 |       |       |
    |   4 |     NESTED LOOPS                               |                              |     1 |   167 |  1561   (1)| 00:00:19 |       |       |
    |   5 |      NESTED LOOPS                              |                              |     1 |   155 |  1560   (1)| 00:00:19 |       |       |
    |   6 |       NESTED LOOPS                             |                              |     1 |   143 |  1556   (1)| 00:00:19 |       |       |
    |   7 |        NESTED LOOPS                            |                              |     1 |   128 |  1555   (1)| 00:00:19 |       |       |
    |   8 |         NESTED LOOPS                           |                              |     1 |   106 |  1550   (1)| 00:00:19 |       |       |
    |   9 |          NESTED LOOPS                          |                              |   186 | 17484 |  1364   (1)| 00:00:17 |       |       |
    |* 10 |           HASH JOIN                            |                              |    86 |  7052 |  1020   (1)| 00:00:13 |       |       |
    |  11 |            NESTED LOOPS                        |                              |    86 |  5848 |  1002   (1)| 00:00:13 |       |       |
    |* 12 |             HASH JOIN                          |                              |    86 |  4472 |   916   (1)| 00:00:11 |       |       |
    |* 13 |              INDEX RANGE SCAN                  | TEST_DETAIL_AK_1             |     1 |    21 |     2   (0)| 00:00:01 |       |       |
    |* 14 |              TABLE ACCESS BY GLOBAL INDEX ROWID| TEST_SESSION_DETAIL          |  8549 |   258K|   914   (1)| 00:00:11 | ROWID | ROWID |
    |* 15 |               INDEX RANGE SCAN                 | TEST_END_DATE_IDX            | 15672 |       |    53   (0)| 00:00:01 |       |       |
    |  16 |             PARTITION HASH ITERATOR            |                              |     1 |    16 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |  17 |              TABLE ACCESS BY LOCAL INDEX ROWID | TEST_SESSION                 |     1 |    16 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 18 |               INDEX UNIQUE SCAN                | PK_TEST_SESSION              |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    |* 19 |            INDEX FAST FULL SCAN                | INSTI_ID_NAME_COUN_DISP_IDX  |  5930 | 83020 |    17   (0)| 00:00:01 |       |       |
    |  20 |           TABLE ACCESS BY GLOBAL INDEX ROWID   | BG_SESSION_DETAIL            |     2 |    24 |     4   (0)| 00:00:01 | ROWID | ROWID |
    |* 21 |            INDEX RANGE SCAN                    | BG_SESS_DETAIL_TEST_SE_FK1_I |     2 |       |     2   (0)| 00:00:01 |       |       |
    |  22 |          PARTITION HASH ITERATOR               |                              |     1 |    12 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 23 |           TABLE ACCESS BY LOCAL INDEX ROWID    | TEST_SESSION                 |     1 |    12 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 24 |            INDEX UNIQUE SCAN                   | PK_TEST_SESSION              |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    |  25 |         TABLE ACCESS BY GLOBAL INDEX ROWID     | BG_QUESTION_USER_RESPONSE    |     4 |    88 |     5   (0)| 00:00:01 | ROWID | ROWID |
    |* 26 |          INDEX RANGE SCAN                      | BG_QUESTION_USER_RESP_IDX1   |     4 |       |     2   (0)| 00:00:01 |       |       |
    |  27 |        PARTITION HASH ITERATOR                 |                              |     1 |    15 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 28 |         TABLE ACCESS BY LOCAL INDEX ROWID      | ITEM                         |     1 |    15 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 29 |          INDEX UNIQUE SCAN                     | PK_ITEM                      |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    |  30 |       TABLE ACCESS BY GLOBAL INDEX ROWID       | BG_SESSION_DETAIL            |     2 |    24 |     4   (0)| 00:00:01 | ROWID | ROWID |
    |* 31 |        INDEX RANGE SCAN                        | BG_SESS_DETAIL_TEST_SE_FK1_I |     2 |       |     2   (0)| 00:00:01 |       |       |
    |  32 |      PARTITION HASH ITERATOR                   |                              |     1 |    12 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 33 |       TABLE ACCESS BY LOCAL INDEX ROWID        | TEST_SESSION                 |     1 |    12 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 34 |        INDEX UNIQUE SCAN                       | PK_TEST_SESSION              |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    |  35 |     TABLE ACCESS BY GLOBAL INDEX ROWID         | BG_QUESTION_USER_RESPONSE    |     4 |    88 |     5   (0)| 00:00:01 | ROWID | ROWID |
    |* 36 |      INDEX RANGE SCAN                          | BG_QUESTION_USER_RESP_IDX1   |     4 |       |     2   (0)| 00:00:01 |       |       |
    |  37 |    PARTITION HASH ITERATOR                     |                              |     1 |    15 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 38 |     TABLE ACCESS BY LOCAL INDEX ROWID          | ITEM                         |     1 |    15 |     1   (0)| 00:00:01 |   KEY |   KEY |
    |* 39 |      INDEX UNIQUE SCAN                         | PK_ITEM                      |     1 |       |     0   (0)| 00:00:01 |   KEY |   KEY |
    Predicate Information (identified by operation id):
       1 - filter(TO_DATE('01-09-09','DD-MON-YY')<=TO_DATE('30-09-09','DD-MON-YY'))
      10 - access("S"."INSTITUTION_ID"="E"."INSTITUTION_ID")
      12 - access("T"."TEST_DETAIL_ID"="D"."TEST_DETAIL_ID")
      13 - access("D"."TEST_NAME"='Reading Comprehension')
      14 - filter("T"."TEST_SESSION_STATUS_ID"=3)
      15 - access(TRUNC(INTERNAL_FUNCTION("TEST_END_DATE"))>=TO_DATE('01-09-09','DD-MON-YY') AND
                  TRUNC(INTERNAL_FUNCTION("TEST_END_DATE"))<=TO_DATE('30-09-09','DD-MON-YY'))
      18 - access("S"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")
      19 - filter(SUBSTR("E"."INSTITUTION_ID_DISPLAY",8,3)<>'000')
      21 - access("B"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")
      23 - filter("C"."STUDENT_ID_PK"="S"."STUDENT_ID_PK")
      24 - access("B"."TEST_SESSION_ID"="C"."TEST_SESSION_ID")
      26 - access("BG"."BG_SESSION_DETAIL_ID"="B"."BG_SESSION_DETAIL_ID")
      28 - filter("I"."UIN"='SBG001')
      29 - access("BG"."ITEM_ID"="I"."ITEM_ID")
      31 - access("B"."TEST_SESSION_ID"="T"."TEST_SESSION_ID")
      33 - filter("C"."STUDENT_ID_PK"="S"."STUDENT_ID_PK")
      34 - access("B"."TEST_SESSION_ID"="C"."TEST_SESSION_ID")
      36 - access("BG"."BG_SESSION_DETAIL_ID"="B"."BG_SESSION_DETAIL_ID")
      38 - filter("I"."UIN"='SBG002')
      39 - access("BG"."ITEM_ID"="I"."ITEM_ID")

    Rob,
    How i can my insert statement here.
    I tried like..but error.
    select /*+ gather_plan_statistics */  INSERT INTO  TEMP_TEST_STAT(
                SELECT S.STUDENT_ID_PK, A.RESPONSE_KEY GENDER, B.RESPONSE_KEY ETHNICITY, T.SCORE SCALE_SCORE ,D.TEST_NAME
                FROM TEST_SESSION_DETAIL T, TEST_SESSION S, STUDENT U, TEST_DETAIL D,
                SELECT I.ITEM_ID, I.UIN, BG.BG_SESSION_DETAIL_ID, BG.RESPONSE_KEY , B.TEST_SESSION_ID, C.STUDENT_ID_PK
                FROM BG_QUESTION_USER_RESPONSE BG, ITEM I, BG_SESSION_DETAIL B, TEST_SESSION C
                WHERE
                BG.ITEM_ID = I.ITEM_ID AND I.UIN = 'SBG002' AND
                BG.BG_SESSION_DETAIL_ID = B.BG_SESSION_DETAIL_ID
                AND B.TEST_SESSION_ID = C.TEST_SESSION_ID ) A,
                SELECT I.ITEM_ID, I.UIN, BG.BG_SESSION_DETAIL_ID, BG.RESPONSE_KEY , B.TEST_SESSION_ID, C.STUDENT_ID_PK
                FROM BG_QUESTION_USER_RESPONSE BG, ITEM I, BG_SESSION_DETAIL B, TEST_SESSION C
                WHERE
                BG.ITEM_ID = I.ITEM_ID AND I.UIN = 'SBG001' AND
                BG.BG_SESSION_DETAIL_ID = B.BG_SESSION_DETAIL_ID
                AND B.TEST_SESSION_ID = C.TEST_SESSION_ID ) B
                ,INSTITUTION E
                WHERE
                D.TEST_NAME = 'Reading Comprehension' AND
                T.TEST_SESSION_STATUS_ID = 3
                AND TRUNC(T.TEST_END_DATE) BETWEEN TO_DATE('01-09-09','DD-MON-YY') AND TO_DATE('30-09-09','DD-MON-YY')
                AND T.TEST_DETAIL_ID = D.TEST_DETAIL_ID
                AND S.STUDENT_ID_PK = U.STUDENT_ID_PK
                AND S.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND A.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND A.STUDENT_ID_PK = S.STUDENT_ID_PK
                AND B.TEST_SESSION_ID = T.TEST_SESSION_ID
                AND B.STUDENT_ID_PK = S.STUDENT_ID_PK
                AND S.INSTITUTION_ID=E.INSTITUTION_ID
                AND SUBSTR(E.INSTITUTION_ID_DISPLAY,8,3)  '000') from dual;please advice

  • Do i need to tune the redolog?

    10g R2 on AIX 5.3L
    this is a typical alert file about the redo log file switching of the day.
    Mon May 28 01:26:33 2007
    Thread 1 advanced to log sequence 24017
    Current log# 4 seq# 24017 mem# 0: /u020/apps/oracle/oradata/BAAN/redo04.log
    Mon May 28 08:04:13 2007
    Thread 1 advanced to log sequence 24018
    Current log# 5 seq# 24018 mem# 0: /u020/apps/oracle/oradata/BAAN/redo05.log
    Mon May 28 08:05:56 2007
    Thread 1 advanced to log sequence 24019
    Current log# 3 seq# 24019 mem# 0: /u020/apps/oracle/oradata/BAAN/redo03.log
    Mon May 28 08:07:29 2007
    Thread 1 advanced to log sequence 24020
    Current log# 2 seq# 24020 mem# 0: /u020/apps/oracle/oradata/BAAN/redo02.log
    Mon May 28 08:08:55 2007
    Thread 1 advanced to log sequence 24021
    Current log# 1 seq# 24021 mem# 0: /u020/apps/oracle/oradata/BAAN/redo01.log
    Mon May 28[b] 08:10:26 2007
    Thread 1 advanced to log sequence 24022
    Current log# 4 seq# 24022 mem# 0: /u020/apps/oracle/oradata/BAAN/redo04.log
    Mon May 28 08:12:05 2007
    Thread 1 advanced to log sequence 24023
    Current log# 5 seq# 24023 mem# 0: /u020/apps/oracle/oradata/BAAN/redo05.log
    Mon May 28 08:13:55 2007
    Thread 1 advanced to log sequence 24024
    Current log# 3 seq# 24024 mem# 0: /u020/apps/oracle/oradata/BAAN/redo03.log
    Mon May 28 11:31:05 2007
    Thread 1 advanced to log sequence 24025
    Current log# 2 seq# 24025 mem# 0: /u020/apps/oracle/oradata/BAAN/redo02.log
    Mon May 28 14:36:13 2007
    Thread 1 advanced to log sequence 24026
    Current log# 1 seq# 24026 mem# 0: /u020/apps/oracle/oradata/BAAN/redo01.log
    Do I need to tune the redo log? Each of redo log file is 50MB. It switched more frequent when there are not many users than real busy hours.
    null

    Select may or may not generate redo. Delayed block cleanout is one of the reasons for a query to produce redo: https://metalink.oracle.com/metalink/plsql/f?p=130:14:2631437878498686237::::p14_database_id,p14_docid,p14_show_header,p14_show_help,p14_black_frame,p14_font:NOT,40689.1,1,1,1,helvetica#aref1
    Another reason is locking the rows with "for update":
    SQL> create table t1 as select * from all_objects;
    Table created.
    SQL> set autot trace stat
    SQL> select * from t1;
    39310 rows selected.
    Statistics
              0  recursive calls
              0  db block gets
           3117  consistent gets
            538  physical reads
              0  redo size
        2524195  bytes sent via SQL*Net to client
          18612  bytes received via SQL*Net from client
           2622  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          39310  rows processed
    SQL> select * from t1 for update;
    39310 rows selected.
    Statistics
             24  recursive calls
          40020  db block gets
          43446  consistent gets
            625  physical reads
        7754052  redo size
        3501635  bytes sent via SQL*Net to client
          18612  bytes received via SQL*Net from client
           2622  SQL*Net roundtrips to/from client
              0  sorts (memory)
              0  sorts (disk)
          39310  rows processed

  • Help needed for writing query

    help needed for writing query
    i have the following tables(with data) as mentioned below
    FK*-foregin key (SUBJECTS)
    FK**-foregin key (COMBINATION)
    1)SUBJECTS(table name)     
    SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
    2           02           Computer Science
    3           03           Physics
    4           04           Chemistry
    5           05           Mathematics
    7           07           Commerce
    8           08           Computer Applications
    9           09           Biology
    2)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
    383           S1      9           4           2           3
    384           S2      4           2           5           3
    ---------I actually designed the ABOVE table also like this
    3) a)COMBINATION
    COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
    383           S1
    384           S2
    b)COMBINATION_DET
    COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
    1               383          9
    2               383          4
    3               383          2
    4               383          3
    5               384          4
    6               384          2          
    7               384          5
    8               384          3
    Business rule: a combination consists of a maximum of 4 subjects (must contain)
    and the user is less relevant to a COMB_NAME(name of combinations) but user need
    the subjects contained in combinations
    i need the following output
    COMB_ID COMB_NAME SUBJECT1 SUBJECT2      SUBJECT3      SUBJECT4
    383     S1     Biology Chemistry      Computer Science Physics
    384     S2     Chemistry Computer Science Mathematics Physics
    or even this is enough(what i actually needed)
    COMB_ID     subjects
    383           Biology,Chemistry,Computer Science,Physics
    384           Chemistry,Computer Science,Mathematics,Physics
    you can use any of the COMBINATION table(either (2) or (3))
    and i want to know
    1)which design is good in this case
    (i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
    good method to link with same table but if 4 subjects only(and must) comes
    detail table is not neccessary )
    now i am achieving the result by program-coding in C# after getting the rows from oracle
    i am using oracle 9i (also ODP.NET)
    i want to know how can i get the result in the stored procedure itsef.
    2)how it could be designed in any other way.
    any help/suggestion is welcome
    thanks for your time --Pradeesh

    Well I forgot the table-alias, here now with:
    SELECT C.COMB_ID
    , C.COMB_NAME
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
    , (SELECT SUB_NAME
    FROM SUBJECTS
    WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
    FROM COMBINATION C;
    As you need exactly 4 subjects, the columns-solution is just fine I would say.

  • Need Help to query Lync Database for User Information

    Need Help to Query the lync database to retrieve below user information.
    1. SIP Address of the registered user
            2. Phone Number configured to the particular account.
            3. IP Address
           4. Last Logged in time.
    I am trying to pull the above information from rtc database for all the registered users. Please let me know if this is possible and it would be great if you can throw some light on what tables to look for the data. Thank You.

    Hi,
    For SIP address and Phone number you can check RTC database.
    IP Address:
    You can refer to the link below to query IP address: 
    http://h30499.www3.hp.com/t5/Business-Service-Management-BAC/Monitoring-Lync-with-the-User-Registrations-Viewer-Free-NMC-tool/ba-p/5961497#.UtOU43mIrwo
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    Last Logged in time:
    You can refer to the link below:
    http://blogs.technet.com/b/dodeitte/archive/2011/05/11/how-to-get-the-last-time-a-user-registered-with-a-front-end.aspx
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • HT3775 I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDI

    I cannot get itunes to work/install on myPC. I am running windows 8 in a 64 bit machine. I also want to purchase books via itunes for my Nook. Are you deliberately excluding PC owners so we cannot use ituens on our computers???? I have selected a community but have no idea what community I should be working with. Can somone explai these communities to me? Also. you don't allow much time to go thru the sign up process. I had to start over SEVERAL times as you kept timing me out. Jesus...when people are signing up for the first time, we have no idea of the questions that will be asked. Give us a break and give us time to sign up. Not everone is disability free and able to go thru your process quickly...you are NOT user friendly. You should be for people who are wanting to join your community. I used to want an Apple product but now that  I have had first hand experience with your web page, I think I will probably stay away from Apple products. VERY DISAPPOINTING

    Jan 11, 2014 10:26 AM  Re: I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDING
      Re: I NEED I TUNES FOR A 64 BIT PC. OPERATING SYSTEM IS WINDOWS 8, NON TOUCH SCREEN. WHICH IS THE ABSOLUTELY BEST WAY TO GET ITUNES OPERATING CORRECTLY ON MY PC????//I HAVE TRIED SEVERAL THINGS, NONE OF WHICH ARE WORKING. IS ITUNES DELIBERATELY EXCLUDING PC'S  in response to Birdlover1      
    Post over in the iTunes for Windows forum, here:
    https://discussions.apple.com/community/itunes/itunes_for_windows
    sebastian

  • Im trying to download the newest version of i tunes because i just got the i phone 5c..it wont download because i have to have i tunes 10.6.8 but it wont letme download that either because i need i tunes 10.6 to get it and i cant find that download..what

    I'm trying to download the newest version of I tunes because I just got the I phone 5c..it wont download because I have to have I tunes 10.6.8 but it wont let me download that either because I need I tunes 10.6 to get it and I can't find that download anywhere..I need to get the book for school on my I pad or phone by tomorrow...what do I do?

    Welcome to Apple Support Communities
    The iPhone 5c needs iTunes 11.1, which requires Mac OS X 10.6.8. See if your Mac can be upgraded to Mac OS X Snow Leopard > http://support.apple.com/kb/sp575 If so, buy Mac OS X Snow Leopard > http://store.apple.com/us/product/MC573Z/A/mac-os-x-106-snow-leopard
    Then, make a backup of your data with Time Machine or Disk Utility's Restore, insert the disc and follow its steps to upgrade to Mac OS X Snow Leopard. You shouldn't lose compatibility with any application. After upgrading, open  > Software Update, and install the latest version. It will install iTunes 11.1, so you will be able to sync the iPhone 5c with your Mac

  • I need a select query

    I have a dataset like below in two columns ( col1,col2 in table Mytable)
    A | ab
    A | cd
    A | ef
    B | xl
    B | ik
    E | 23
    E | op
    C | tk
    I need a select query which will return first set of every group which I ask for .
    For example, if I ask for data for A , B , the select query will return records
    A | ab
    B | xl
    For example, if I ask for data for B ,E the select query will return records..
    B | xl
    E | 23
    For example, if I ask for data for C the select query will return records..
    C | tk
    How do I write my select query ?

    Something like this ?
    SCOTT@orcl> create table test(col1 varchar2(1),col2 varchar2(2));
    Table created.
    SCOTT@orcl> insert into test values('A','ab');
    1 row created.
    SCOTT@orcl> insert into test values('A','cd');
    1 row created.
    SCOTT@orcl> insert into test values('A','ef');
    1 row created.
    SCOTT@orcl> insert into test values('B','xl');
    1 row created.
    SCOTT@orcl> insert into test values('B','ik');
    1 row created.
    SCOTT@orcl> insert into test values('E','23');
    1 row created.
    SCOTT@orcl> insert into test values('E','op');
    1 row created.
    SCOTT@orcl> insert into test values('C','tk');
    1 row created.
    SCOTT@orcl> commit;
    Commit complete.
    SCOTT@orcl>
    SCOTT@orcl> ed
    Wrote file afiedt.buf
      1  select * from (
      2  select decode(lag(col1) over (order by col1,rownum),null,col1
      3  ,col1,null
      4  ,col1) col1
      5  ,col2
      6  from test) aaa
      7* where aaa.col1='A'
    SCOTT@orcl> /
    C CO
    A abHTH
    Girish Sharma

  • Need help in query to have all items in sap with PO data on order, date

    Hello Everyone,
    I need some help in writing a query to show all items in sap db to have itemcode, itemname, onhand, sellable(onhand-committed), on order, and the delivery date when that time should be received.  I need to know what items are regular items, which ones are master and components.  For the master I need to have the deliver date of the PO for the component.
    I have written this.
    SELECT DISTINCT TOP (100) PERCENT T1.ItemCode, SUM(T1.Sellable) AS Sellable, T1.OnOrder, MAX(T1.Docduedate) AS DeliveryDate, T1.WhsCode
    FROM         (SELECT     ItemCode, Sellable, OnOrder, '1/1/1900' AS Docduedate, WhsCode
                           FROM          dbo.V_RAZ_StoreInv
                           UNION ALL
                           SELECT     TOP (100) PERCENT ItemCode, '0' AS Sellable, Quantity AS Onorder, DocDueDate, WhsCode
                           FROM         dbo.V_RAZ_OPENPOSDATA
                           ORDER BY ItemCode) AS T1 LEFT OUTER JOIN
                          dbo.V_RAZ_ItemInfo ON T1.ItemCode = dbo.V_RAZ_ItemInfo.ItemCode
    GROUP BY T1.ItemCode, T1.OnOrder, T1.WhsCode, dbo.V_RAZ_ItemInfo.OnHold
    HAVING      (dbo.V_RAZ_ItemInfo.OnHold = 'n')
    ORDER BY T1.ItemCode, T1.WhsCode
    and for the v_raz_openposdata I have the following query
    SELECT     dbo.OPOR.DocNum, dbo.OPOR.DocStatus, dbo.POR1.WhsCode, dbo.POR1.ItemCode, dbo.POR1.Dscription, dbo.POR1.Quantity, dbo.POR1.OpenQty,
                          dbo.POR1.LineStatus, dbo.OPOR.DocDueDate
    FROM         dbo.OPOR LEFT OUTER JOIN
                          dbo.POR1 ON dbo.OPOR.DocEntry = dbo.POR1.DocEntry
    WHERE     (dbo.OPOR.DocStatus = 'O')
    Any help is greatly appreciated. 
    Right now I do get the delivery date for regular items and components but the master sku for the component all of them have 1/1/1900. 
    Thank you

    Thank you for replying Gordon.  I did not remember I had asked this before.  I no longer have access to the other account. 
    What I need on the query is that I want  a list of items with the on order quantity and when we are expecting this order to be received.  The receiving date is based on the PO delivery date.  The trick here is that  I need to Master sku to show the delivery date of the component sku.  In my scenario all components have the same delivery date for the Master sku.  If there are mulitple delivery dates because each warehouse is getting them on a different date then I want to get the delivery date for that warehouse.
    Let me know if this is possible and if yes please guide towards a query for it.
    Thank you.

  • Need tcode for Query analyzer

    hi i want to test query in query analyzer befor using in programe.
    i need tcode for query analyzer.
    thanks in advanced.

    hi,,
    SE30 - gives you a run time analysis and points out the issues more at design time.
    ST05 - Is the most useful if you want to track time taken for execution of each of the sections.
    SM50 - Will give you a work process overview, not sure at a program level how can it help you.
    Some times you will have to use a combination of SE30 and ST05.
    I would like to use St05 personally.
    rgds
    anver
    if hlped mark points

  • I need i tunes 10.5 for my i phone 4s and cant download onto my 64bit windows 7 laptop treid everything any ideas???

    i need i tunes 10.5 for my i phone 4s and cant download onto 64 bit windows 7 laptop tried everything anyone help me please????

    true. but he is right itunes automatically sees your running 64 bit and as soon as you go to the site on left hand side of sceen you see download 10.5 just click it and you should see this it automatically points to 64 bit install then you just hit download again. pretty simple
    Tunes 10.5 for Windows (64-bit)
    Email me New On iTunes and special iTunes offers.
    Keep me up to date with Apple news, software updates, and the latest information on products and services.
    then right below this it says download
    or just click this link http://www.apple.com/itunes/download/

  • Need help in query to display lot and serial numbers for a Wip Job Component

    Hi ALL,
    I have a requirement as below.
    I need to display lot and serial numbers for a Wip Job Component, i have a xml report in that for each wip job component i need to check whether it is a lot control item or serial control item based on that i need to display some data. so can you please help me to get the query to indentify the lot and serial number for a wip job component.
    Thanks

    Thank you for replying Gordon.  I did not remember I had asked this before.  I no longer have access to the other account. 
    What I need on the query is that I want  a list of items with the on order quantity and when we are expecting this order to be received.  The receiving date is based on the PO delivery date.  The trick here is that  I need to Master sku to show the delivery date of the component sku.  In my scenario all components have the same delivery date for the Master sku.  If there are mulitple delivery dates because each warehouse is getting them on a different date then I want to get the delivery date for that warehouse.
    Let me know if this is possible and if yes please guide towards a query for it.
    Thank you.

  • Need help with query joining several tables into a single return line

    what i have:
    tableA:
    puid, task
    id0, task0
    id1, task1
    id2, task2
    tableB:
    puid, seq, state
    id0, 0, foo
    id0, 1, bar
    id0, 2, me
    id1, 0, foo
    id2, 0, foo
    id2, 1, bar
    tableC:
    puid, seq, date
    id0, 0, 12/21
    id0, 1, 12/22
    id0, 2, 12/22
    id1, 0, 12/23
    id2, 0, 12/22
    id2, 1, 12/23
    what i'd like to return:
    id0, task0, 12/21, 12/22, 12/22
    id1, task1, 12/23, N/A, N/A
    id2, task2, 12/22, 12/23, N/A
    N/A doesn't mean return the string "N/A"... it just means there was no value, so we don't need anything in this column (null?)
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line...
    id0, task0, 12/21
    id0, task0, 12/22
    id0, task0, 12/23
    id1, task1, 12/23
    is this possible fairly easily?
    Edited by: user9979830 on Mar 29, 2011 10:53 AM
    Edited by: user9979830 on Mar 29, 2011 10:58 AM

    Hi,
    Welcome to the forum!
    user9979830 wrote:
    what i have:...Thanks for posting that so clearly!
    Whenever you have a question, it's even better if you post CREATE TABLE and INSERT statements for your sample data, like this:
    CREATE TABLE     tablea
    (       puid     VARCHAR2 (5)
    ,     task     VARCHAR2 (5)
    INSERT INTO tablea (puid, task) VALUES ('id0',  'task0');
    INSERT INTO tablea (puid, task) VALUES ('id1',  'task1');
    INSERT INTO tablea (puid, task) VALUES ('id2',  'task2');
    CREATE TABLE     tablec
    (       puid     VARCHAR2 (5)
    ,     seq     NUMBER (3)
    ,     dt     DATE          -- DATE is not a good column name
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  0,  DATE '2010-12-21');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  1,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id0',  2,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id1',  0,  DATE '2010-12-23');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  0,  DATE '2010-12-22');
    INSERT INTO tablec (puid, seq, dt) VALUES ('id2',  1,  DATE '2010-12-23');This way, people can re-create the problem and test their ideas.
    It doesn't look like tableb plays any role in this problem, so I didn't post it.
    Explain how you get the results from that data. For example, why do you want this row in the results:
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/21/2010 12/22/2010 12/22/2010rather than, say
    PUID  TASK  DT1        DT2        DT3
    id0   task0 12/22/2010 12/21/2010 12/22/2010? Does 12/21 have to go in the first column because it is the earliest date, or is it because 12/21 is related to the lowest seq value? Or do you even care about the order, just as long as all 3 dates are shown?
    Always say what version of Oracle you're uisng. The query below will work in Oracle 9 (and up), but starting in Oracle 11, the SELECT ... PIVOT feature could help you.
    i can get output like below through several joins, however i was hoping to condense each "id" into a single line... Condensing the output, so that there's only one line for each puid, sounds like a job for "GROUP BY puid":
    WITH     got_r_num     AS
         SELECT     puid
         ,     dt
         ,     ROW_NUMBER () OVER ( PARTITION BY  puid
                                   ORDER BY          seq          -- and/or dt
                           )         AS r_num
         FROM    tablec
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT       a.puid
    ,       a.task
    ,       MIN (CASE WHEN r.r_num = 1 THEN r.dt END)     AS dt1
    ,       MIN (CASE WHEN r.r_num = 2 THEN r.dt END)     AS dt2
    ,       MIN (CASE WHEN r.r_num = 3 THEN r.dt END)     AS dt3
    ,       MIN (CASE WHEN r.r_num = 4 THEN r.dt END)     AS dt4
    FROM       tablea    a
    JOIN       got_r_num r  ON   a.puid  = r.puid
    GROUP BY  a.puid
    ,            a.task
    ORDER BY  a.puid
    ;I'm guessing that you want the dates arranged by seq; that is, for each puid, the date related to the lowest seq comes first, regardless of whther that date is the earliest date for that puid or not. If that's not what you need, then change the analytic ORDER BY clause.
    This does not assume that the seq values are always consecutive integers (0, 1, 2, ...) for each puid. You can skip, or even duplicate values. However, if the values are always consecutive integers, starting from 0, then you could simplify this. You won't need a sub-query at all; just use seq instead of r_num in the main query.
    Here's the output I got from the query above:
    PUID  TASK  DT1        DT2        DT3        DT4
    id0   task0 12/21/2010 12/22/2010 12/22/2010
    id1   task1 12/23/2010
    id2   task2 12/22/2010 12/23/2010As posted, the query will display the first 4 dts for each puid.
    If there are fewer than 4 dts for a puid, the query will still work. It will leave some columns NULL at the end.
    If there are more than 4 dts for a puid, the query will still work. It will display the first 4, and ignore the others.
    There's nothing special about the number 4; you could make it 3, or 5, or 35, but whatever number you choose, you have to hard-code that many columns into the query, and always get that many columns of output.
    For various ways to deal with a variable number of pivoted coolumns, see the following thread:
    PL/SQL
    This question actually doesn't have anything to do with SQL*Plus; it's strictly a SQL question, and SQL questions are best posted on the "SQL and PL/SQL" forum:
    PL/SQL
    If you're not sure whether a question is more of a SQL question or a SQL*Plus question, then post it on the SQL forum. Many more people pay attention to that forum than to this one.

  • Need to Tune program -Urgent

    Hi ,
         I had one ZEE program which has 25 files as input file (input data's . Here the logic of the program is as mention below.
    1.initializition .
    2.get_file_names.(All 25 files name is get in the same perform )
    3.write_job_log.
    4.open_files.(Open 25 files at a time )
    5.read_surr_ctl_file.
    6.load_internal_tabs.( Load 25 files data to ITAB )
    7.create_edi214_tables.
    8.process_ekko_ekpo.(Proces the ITAB data at the time.)
    9.refresh_internal_tables.
    Here they are openning 25 files , then loading all 25 files to ITAB and processing all the loaded datas.
    When this progarm is schedule in background it takes 1.25 hrs to complete the process .
    I need to tune this program which ever possible way.   
    My thought and analysis in this program is -> This performance problem is due to like  openning 25 files , then loading all 25 files to ITAB and processing all the loaded datas which may hit the performance . Kindly let me know you IDEAS and experence on this issue . This program is having 10000 lines of code ..
    Regards,
    Veera

    Hi,
    This program has a lot of steps and the best way to solve its performance problems is with SE30.
    I think you should execute SE30 in development environment e check the steps where there is bad performance.
    If you improve the performance in the development environment you will improve also in production environment.
    Regards,
    Fernando

Maybe you are looking for

  • Deployment of forms 6.0 on the web

    Problem in deployment of Developer forms on the web: If i give URL as http://hostName:5555/webhtml/forms60test3.htm and not specifying username and password in module detalis (in HTML file) i am getting th following error: FRM-99999: A network error

  • Has anyone deleted the Lenovo Store app on an A1?

    I have no desire to use the Lenovo app store and I would like to delete the app which isn't a problem given that I have root access and the appropriate tool for deleting the app. My only concern is what will happen to the toolbar on the bottom of the

  • Need imm response

    When i run an abap hr report using foreground or background iam able to create a business event in PV11 transaction.Using this business event further logic will go. But when the same report run by autosys user it is not creating the business event an

  • How To Restart After Reporting a Failure?

    In my packages a failing step links to a step which sends an e-mail reporting the reason for the failure using odiRef.getPrevStepLog("MESSAGE"). The e-mail step then must itself fail to stop the package from continuing. This all works well, but how c

  • I am attempting to install latest version of flashplayer on my 1st gen Kindle Fire.

    I am attempting to install latest version of flashplayer on my 1st gen Kindle Fire. The file downloads but get error message stating unable to open file. According to website I am using Mac osx but I have tried in both Windows and MAC with same resul