Need help decifering where clause

What do these excerpts from where statements do?
1) and a_id = b_id + 0
also
2) and a_position = b.position || ''
More importantly where does this kind of stuff show up in the Oracle documentation (joins?)
Thanks
Holly

Functionally, those clauses are identical to
and a_id = b_idand
and a_position = b.positionThe difference is that adding 0 or concatenating a NULL prevents Oracle from using an index on b_id of b.position. That may have been intentional on the part of a previous developer, particularly if the application was originally written using the rule-based optimizer.
Justin
Frank beat me to it.
Message was edited by:
Justin Cave

Similar Messages

  • Need Help on where clause condition

    Hello All,
    Thanks in advance::
    I have below SQL query which is returning 1500 records when i dont use any condition in where clause(Please see the query below);
    SELECT POS_TYPE,
    POS_ID,
    SUB_ACNT_ID,
    CHRG,
    DOC,
    NULL,
    ACNT_RLN,
    ACCOUNT_FLODERS_VER,
    DM_LSTUPDDT,
    DM_BTNUMBER,
    DM_USERID,
    DM_WSID,
    STAT_FLG,
    SERVICES_FLG,
    SERVICES,
    INTRST_COND,
    PST_INSTRN
    FROM &&SRC.ACCOUNT_FOLDERS,
    &&SRC.DB;
    Output: 15 rows retured
    And when i validate the data by putting some conditions in where clause , it is giving 1499 records ( Please see the query below with condition )
    SELECT POS_TYPE,
    POS_ID,
    SUB_ACNT_ID,
    CHRG,
    DOC,
    NULL,
    ACNT_RLN,
    ACCOUNT_FLODERS_VER,
    DM_LSTUPDDT,
    DM_BTNUMBER,
    DM_USERID,
    DM_WSID,
    STAT_FLG,
    SERVICES_FLG,
    SERVICES,
    INTRST_COND,
    PST_INSTRN
    FROM &&SRC.ACCOUNT_FOLDERS,
    &&SRC.DB
    WHERE (POS_TYPE,
    POS_ID,
    SUB_ACNT_ID) IN (SELECT POS_TYPE,
    POS_ID,
    SUB_ACNT_ID FROM ACCOUNT
    WHERE DM_LSTUPDDT > 1_LAST_RUN_DATE OR 1_FIRST_RUN_FLAG=1);
    Now, I wanted to know that missing record(1st SQL is giving 1500 rows without any condition & 1nd SQL is giving 1499 rows with condition in where clause)
    I am worried and confused to find out the missing record. Tried with different conditions like Not In... nothing worked perfectly.
    Could some one please have a look and provide me the correct SQL , Performance wise also it should be good, SQL should not cause any performance issues.
    Please help me on it..
    Thanks,
    MKR

    Do a minus
    SELECT POS_TYPE,
           POS_ID,
           SUB_ACNT_ID,
           CHRG,
           DOC,
           NULL,
           ACNT_RLN,
           ACCOUNT_FLODERS_VER,
           DM_LSTUPDDT,
           DM_BTNUMBER,
           DM_USERID,
           DM_WSID,
           STAT_FLG,
           SERVICES_FLG,
           SERVICES,
           INTRST_COND,
           PST_INSTRN
      FROM &&SRC.ACCOUNT_FOLDERS, &&SRC.DB;
    MINUS
    SELECT POS_TYPE,
           POS_ID,
           SUB_ACNT_ID,
           CHRG,
           DOC,
           NULL,
           ACNT_RLN,
           ACCOUNT_FLODERS_VER,
           DM_LSTUPDDT,
           DM_BTNUMBER,
           DM_USERID,
           DM_WSID,
           STAT_FLG,
           SERVICES_FLG,
           SERVICES,
           INTRST_COND,
           PST_INSTRN
      FROM &&SRC.ACCOUNT_FOLDERS, &&SRC.DB
    WHERE (POS_TYPE, POS_ID, SUB_ACNT_ID) IN (SELECT POS_TYPE, POS_ID, SUB_ACNT_ID
                                                 FROM ACCOUNT
                                                WHERE DM_LSTUPDDT > 1_LAST_RUN_DATE
                                                   OR  1_FIRST_RUN_FLAG = 1);  G.

  • HT1338 Need help locating where and how to update Mac OS-X 10.6.5 to the latest Mountain Lion Software...thanx John

    I need help locating where and how to update Mac OS-X to Mountain Lion.....Thanx....Jay

    First update your 10.6 version to 10.6.8 from the software update under the Apple Menu.
    This will add direct access to the Mac App store via a new application.
    Now launch the App Store from your Applications folder - Its the new icon a letter A formed from a ruler pencil and pen on a blue circle !
    Once launched you need to add your iTunes account details or create an account add payment details etc...
    Sign in purchase download and follow install processes to upgrade to 10.8 Mountain Lion.
    OH and to be safe BEFORE you install backup your current system to an external drive !

  • Help on Where clause

    Hi,
    I am a newbie on Oracle and I need help on this problem:
    I have a data block in a form and I need to insert in the Property 'WHERE CLAUSE' a where clause based on the conditions:
    1) ANA_TYPE := TXT_ANA_TYPE AND ANA_CODE := TXT_ANA_CODE. The two variable are initialized in Header Block. No problem for this.
    2) The other Where clause depend from an other variable of the Header Block . For example:
    If :SITUATION = 1 then the clause must be AND DOC_PAID <> 0
    if :SITUATION = 2 then the clause must be AND DOC_PAID = 0
    if :SITUATION = 3 then the clause must be AND DOC_INS <> 0
    Is possible to create a unique Where clause with this conditions ? If Yes How?
    I hope...
    Best Regards
    Gaetano

    and abs(sign(doc_paid)) = abs(sign(:situation-2))Also beware when you are using the where clause property in Forms. Make sure you refer to the Forms-fields and not to its contents.
    So use 'field1 = :block.item1' and not 'field1 = ' || :block.item1
    The first one used bind variables and will therefore share the plan of the query stored in the library cache, the latter one doesn't and will leave you with lots of unique statements that will thrash your shared_pool and will ultimately kill the performance.
    Regards,
    Rob.

  • Need logic for WHERE-clause

    Hi,
    I have a selet statement where i need to write below logic .
    SELECT bldat xblnr kunnr rstgr xref1 xref2
               bukrs belnr blart wrbtr waers shkzg
               buzei zfbdt dmbe2 sgtxt augbl augdt
               zbd1t zbd2t
          FROM  bsid
          INTO CORRESPONDING FIELDS OF TABLE int_output
          WHERE bldat IN so_bldat AND
                   shkzg IN so_shkzg AND
                    wrbtr IN so_wrbtr.      
    Range needs to be  entered where from value (for wrbtr field) is -ve negative and to value is +ve positive e.g., -1000 to +200 -:in this case go to BSID with value from 0 to 1000 with debit/credit indicator H and again 0 to 200 with debit/credit indicator S..
    can somebody tell me how to set range for the above requirement.
    Really need help.
    Edited by: Thomas Zloch on May 25, 2011 3:27 PM

    change:
    AND
    shkzg IN so_shkzg AND
    wrbtr IN so_wrbtr.
    to
    and  ( (SHKZG eq 'H' and wrbtr le 1000 ) or
              (SHKZG eq 'S' and wrbtr le 200 ) ).  ??

  • Need comment on WHERE clause

    i want to know in what order conditions in where clause evaluates.
    select * from table
    where emp_id
    and tran_year
    and tran_mon
    select * from table
    where tran_mon
    and tran_year
    and emp_id
    consider tran_year, tran_mon , emp_id are primary key and table having record month wise , and consider employees are 50,000, so for one month 50000 record will be there .
    so i believe 2nd query will faster than 1st one , becse oracle read from bottom so it will first filter acording emp_id .Please tell me if i m wrong

    user12108669 wrote:
    thanx for reply
    but in very simple case like this one , in which we have only primary key ,, and only one table ,, in that case also order will be ignored .?Yes especially for the simple cases the order is of no relevance.
    If you join more then 10 tables the number of permutations for those tables (all combinations) will be quite big. There is a (undocumented) parameter that influences the CBO on how many tables/permutations it will try. This influences the parsing time of the query. But for simple queries such a thing has absolutly no consequence.
    Sorry I was talking about having multiple tables in the FROM clause. Not about multiple condition in the where clause. The main thing still is identical. The order has no real relevance. CBO will choose an order mostly depending on index usage. There could be more complexe example where the order might get some importance again, but those are extremly special cases (I think jonathan lewis once showed such an example) Difficult to dig it up now.
    Edited by: Sven W. on Dec 2, 2010 3:19 PM
    Edited by: Sven W. on Dec 2, 2010 3:20 PM

  • Need help using WITH clause

    I have an update statement that is using the same suquery twice.
    I am not usre if WITh clause be used in update statements?
    Is there a way the below statement can be modified to use WITH clause?
    UPDATE EMP_TRACKING_LIST L
    SET ACTIVE_FLAG = DECODE((SELECT COUNT(*)
    FROM EMP_TRACKING_LIST L2
    WHERE L.NAME = L2.NAME AND
    L.EMP_CODE = L2.EMP_CODE AND
    L2.EMP_FLAG = 'Y'), 0, 'N', 'Y')
    WHERE ACTIVE_FLAG != DECODE((SELECT COUNT(*)
    FROM EMP_TRACKING_LIST L2
    WHERE L.NAME = L2.NAME AND
    L.EMP_CODE = L2.EMP_CODE AND
    L2.EMP_ACTIVE_FLAG = 'Y'), 0, 'N', 'Y')
    OR EMP_ACTIVE_FLAG IS NULL;
    I would really appreciate your input
    Edited by: user10937534 on Sep 2, 2009 4:47 PM

    Hi,
    WITH comes immediately before SELECT, not before UPDATE.
    To use WITH in an UPDATE statement, you would say something like:
    UPDATE  EMP_TRACKING_LIST  L
    SET     ACTIVE_FLAG =
            WITH  sub_q  AS
                SELECT  ...
            SELECT  ...
            FROM    sub_q  ...
    ;I don't think there's any way to use values from the sub-query in the WHERE clause of the UPDATE statement itself; MERGE is a much better bet for eliminating redundancy there.
    Sorry, I'm not at a database now, so I can test anything.

  • Need help in 'WITH CLAUSE' Query

    Hello Gurus,
    I am trying to calculate the count of distinct members for each provid.
    I am using the with clause to get information regarding the provid.
       WITH T AS
      (SELECT a.UD_ID MRR_ID,
                            A.UD_LASTNAME LAST_NAME,
                            A.UD_FIRSTNAME FIRST_NAME,
                            COUNT(DISTINCT DP.PA_PROVIDERID) PROVIDERS_ASSIGNED
                       FROM (SELECT UD.UD_ID,
                                    UD_LASTNAME,
                                    UD_FIRSTNAME
                               FROM USER_DETAILS       UD,
                                    MAP_USERS_TO_ROLES MR
                              WHERE MR.MUR_UR_ID_REF = 1000
                                AND MR.MUR_UD_ID_REF = UD.UD_ID) A,
                            D4C_PROVIDER_ASSIGNMENT DP
                      WHERE A.UD_ID = DP.PA_ASSIGNEDTO
                      AND dp.pa_status ='A'
                      GROUP BY A.UD_ID,
                               A.UD_LASTNAME,
                               A.UD_FIRSTNAME
                      ORDER BY 3 DESC)    OUTPUT of just above query without WITH clause.
    MRR_ID     LAST_NAME     FIRST_NAME     PROVIDERS_ASSIGNED
    1229    mrrTest         mrrTest         4
    1228    mrr2Last        mrr2First       5
    1230    mrr1Last        mrr1First       7
    1226    Panwar          SIngh           1
    1181    MRRLast         MRRTest         4
    1221    One             MRR             1
    1322    Thakuria        Bibhuthi        2I am creating this and get all the information to show on front end. Now I want to calculate the no of members as per the providers assigned for each MRR_ID
    Below query show the no of members for all the providers assigned to a provider.
    ex:
    SELECT * FROM (   
    SELECT COUNT(DISTINCT dmpc_hicn) countmember
    FROM D4C_HICN_PROVIDER_claims  a WHERE trim(DPMC_PROVIDER_NO) IN 
    (SELECT trim(pa_providerid)
       FROM d4c_provider_assignment
       WHERE pa_assignedto = 1181  (mrr_id)    --here i have use the mrrid from with clause and get the member count with all the columns coming from WITH CLAUSE.
       AND pa_roleid = 1000
       AND PA_STATUS ='A'
    GROUP BY a.dmpc_ss_id_ref)Right now I am using materialized view i dont wanna use the same..
    I am sending the materialized view code as well what i am doing ..
    ( SELECT SUM(member_count)member_count_bynpi ,mrr_id  FROM (
    (SELECT count(DISTINCT hp.dmpc_hicn) member_count,hp.DMPC_SS_ID_REF ,a1.ud_id mrr_id FROM  D4C_HICN_PROVIDER_claims hp ,
    (SELECT   a.UD_ID ,DP.PA_PROVIDERID
         FROM (SELECT UD.UD_ID, UD_LASTNAME, UD_FIRSTNAME
                 FROM USER_DETAILS UD, MAP_USERS_TO_ROLES MR
                WHERE MR.MUR_UR_ID_REF = 1000
                  AND MR.MUR_UD_ID_REF = UD.UD_ID) A,
              D4C_PROVIDER_ASSIGNMENT DP
        WHERE A.UD_ID = DP.PA_ASSIGNEDTO
        AND dp.pa_status ='A'
        /*AND dp.PA_ASSIGNEDTO = 1221*/) a1
        WHERE trim(a1.PA_PROVIDERID) = trim(hp.dpmc_provider_no)
        GROUP BY a1.ud_id,hp.DMPC_SS_ID_REF))
        GROUP BY mrr_id)Please help me to write the code with the materialized view. Thanks in Advance.
    Kind regards,
    UP
    Edited by: BluShadow on 22-Aug-2011 07:58
    fixed {noformat}{noformat} tags.  Please use lowercase "code" rather than uppercase "CODE" in the tags.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Probably, this may help
    WITH T1 as(
               SELECT UD.UD_ID,
                      UD_LASTNAME,
                      UD_FIRSTNAME
                FROM USER_DETAILS UD, MAP_USERS_TO_ROLES MR
                WHERE MR.MUR_UR_ID_REF = 1000
                AND MR.MUR_UD_ID_REF = UD.UD_ID)
          T2 as (SELECT a.UD_ID ,DP.PA_PROVIDERID
                 FROM T1 A, D4C_PROVIDER_ASSIGNMENT DP
                 WHERE A.UD_ID = DP.PA_ASSIGNEDTO
                 AND dp.pa_status ='A')
           T3 as(SELECT count(DISTINCT hp.dmpc_hicn) member_count,
                              hp.DMPC_SS_ID_REF ,
                               a1.ud_id mrr_id
                  FROM T2 A1 ,D4C_HICN_PROVIDER_claims hp
                  WHERE trim(a1.PA_PROVIDERID) = trim(hp.dpmc_provider_no)
                  GROUP BY a1.ud_id,hp.DMPC_SS_ID_REF)
    SELECT SUM(member_count)member_count_bynpi ,mrr_id from T3
    GROUP BY mrr_id

  • IPhoto-I need help identifying where the photos are

    On another forum (Mac rumours), somebody posted:
    the way iPhoto works is that when you import pictures into iPhoto, it will be stored on an iPhoto library file, literally called "iPhoto Library". This file is normally stored in your "Pictures" folder, but if you moved it to an external hard drive, thats where it will be. So any stray pictures you can see outside of iPhoto (for example, any pictures you see in your pictures folder) doesn't necessarily mean its in iPhoto, and are not actually linked to iPhoto in any way. So anything you do to those, whether its delete, edit, or move, the iPhoto library will not capture those changes since it has its own copy of the file stored in the iPhoto library file.
    My Q is this: I see numerous photos right below the iPhoto library, in Finder (see below): are the .jpg files that I see, the ones that are in my iPhoto library? In others words, if I delete them, will they also be deleted from my iPhoto library? It would seem from the above posting that the "stray" photos are *not* part of the iPhoto library, but I'm unclear as to whether this is so, or whether I've misunderstood what they wrote. I want to know if the individual jpg's (that are listed under iphoto library, *are* my photos within my iPhoto library.
    Thanks very much!

    Keith:
    Thanks a lot for this. So, I *have* checked the iPhoto Library (by that, I mean clicking on iPhoto library-the 20.12 gb file you see above in my screenshot) and my photos are all there. At least, I'm 99.9% sure they are *all* there. I've created albums and moved some photos into albums, but suffice to say that when I open iPhoto, I have 2,000+ photos in "Photos" and in my most recent album I have 900; when I count the # in the above screen shot, there are approx 1,100 so I'm sure I have all or most of them. I'm just wondering how they got there....
    Terrence:
    I didn't make any change to the Library settings and the box *is* checked so I'm presuming I don't have a referenced library. My iPhoto library is on my external hard drive-I've chosen that location to import my photos from my iPhone, With that, what is the difference between my iPhoto library and a folder called "iphoto libraries"; I must have created the folder called iPhoto libraries, but the jpg's that are in that folder are also the photos/files that are in my iPhoto library....give or take a few (I've deleted some along the way from my iPhoto library).
    I'm not understanding the structure of the files, i.e., can I safely delete the .jpg files in the folder "iPhoto libraries"? Terrence-from what you can see in the screenshot, did I manually copy the files to that location? I don't recall doing so. All I know is that I imported my photos from my iPhone to my external hard drive.
    When I click on iPhoto library....the large file (20.12 gb) all of my photos are there.
    Many thanks for any clarification you can provide (I'm happy to provide further screen shots for you if it will help you make sense of my structuring)!

  • I Need help with where to install .pto files.

    I have several preset files in the .pto format and I'm trying to install them into PS 5.1 and can't figure out where to deposit them so the program recognizes them and makes them available for use. Any help greatly appreciated!

    That file extension .pto doesn't sound familar as far as anything photoshop uses.
    What are they supposed to be used for in photoshop?

  • I have EMS 3.5 installed and functioning. Need help with where to go next!

    Hello All,
    I am brand new to this and need a very basic push in the right direction.
    I have FMS 3.5 installed on my server and I am ready to begin testing with it.
    My website has a page with descriptions of videos and links to those videos.
    When a link is selected, I want a new page to open and the video to play in the FMS player.
    I have absolutely no idea how to go about this. I need some meaty information here. I read tom Green's tutorials, and although I found that they were informative, they are also quite general.
    I have Flash Professional CS4 and I just need to know what the heck to do next.
    Any and all help will be supremely appreciated.
    Sincerely,
    wordman

    Gentlemen,
    Thank you for the answers, I will definitely look into what you both suggested.
    My next step is getting a player into a separate page that plays selected videos through RTMP.
    The player that comes with FMS would be fine, but I do not know how to alter it, change colors, etc.
    Then I was looking into Real Eyes' REOPS player, and the white papers alone stopped me in my tracks. I realize it's probably easy, but now ehrn you are a novice, to understand it.
    Then I saw Adobe Strobe, the OSMF-based player and thought that might be good for me.
    The biggest problem I see is that Adobe's resources are not always easy to find on this website, same goes fo rthe OSMF site. Not very well structured sites for a software company.
    Bottom line is, I need to get a player on a page that plays though RTMP. Any thoughts there? I'm completely new to Flash.
    Thank you all!!!
    Sincerely,
    wordman

  • Need help with WITH Clause and Outer-Joins

    Hi,
    I have been struggling to understand these queries.
    C:\>sqlplus /nolog
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 20 15:28:33 2011
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    SQL> conn hr@xe
    Enter password:
    Connected.
    SQL> with week as ( select * from (select 1 item, 10 qty, 1 week from dual ))
      2  select main.item
      3       , week1.qty qty1
      4       , week2.qty qty2
      5    from week week1
      6       , week week2
      7       , ( select 1 item from dual ) main
      8   where main.item = week1.item (+)
      9     and week1.week (+) = 1
    10     and main.item = week2.item (+)
    11     and week2.week (+) = 2
    12     ;
          ITEM       QTY1       QTY2
             1
    SQL> with week as ( select 1 item, 10 qty, 1 week from dual )
      2  select main.item
      3       , week1.qty qty1
      4       , week2.qty qty2
      5    from week week1
      6       , week week2
      7       , ( select 1 item from dual ) main
      8   where main.item = week1.item (+)
      9     and week1.week (+) = 1
    10     and main.item = week2.item (+)
    11     and week2.week (+) = 2
    12     ;
          ITEM       QTY1       QTY2
             1         10
    SQL>I don't understand why the first query won't show the result for QTY1. The only difference they have is that the first uses an additional inline view.
    Can someone please explain the reason behind.
    Thanks,
    Allen
    Edited by: Allen Sandiego on Oct 20, 2011 3:31 PM
    Enclosed in CODE tags.

    Also in 10.2.0.4.0. The predicate part contains a clue about the transformation
    mhouri > select * from v$version;
    BANNER                                                                         
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi               
    PL/SQL Release 10.2.0.4.0 - Production                                         
    CORE     10.2.0.4.0     Production                                                     
    TNS for Solaris: Version 10.2.0.4.0 - Production                               
    NLSRTL Version 10.2.0.4.0 - Production                                         
    mhouri > with week as ( select * from (select 1 item, 10 qty, 1 week from dual ))
      2        select
      3               main.item
      4             , week1.qty qty1
      5             , week2.qty qty2
      6          from week week1
      7             , week week2
      8             , ( select 1 item from dual ) main
      9         where main.item = week1.item (+)
    10           and week1.week (+) = 1
    11          and main.item = week2.item (+)
    12          and week2.week (+) = 2;
          ITEM       QTY1       QTY2                                                                                       
             1                                                                                                             
    mhouri > select * from table(dbms_xplan.display_cursor);
    | Id  | Operation                  | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |             
    |   0 | SELECT STATEMENT           |                             |       |       |     8 (100)|          |             
    |   1 |  TEMP TABLE TRANSFORMATION |                             |       |       |            |          |             
    |   2 |   LOAD AS SELECT           |                             |       |       |            |          |             
    |   3 |    FAST DUAL               |                             |     1 |       |     2   (0)| 00:00:01 |             
    |   4 |   MERGE JOIN OUTER         |                             |     1 |    18 |     6   (0)| 00:00:01 |             
    |   5 |    NESTED LOOPS OUTER      |                             |     1 |     9 |     4   (0)| 00:00:01 |             
    |   6 |     FAST DUAL              |                             |     1 |       |     2   (0)| 00:00:01 |             
    |*  7 |     VIEW                   |                             |     1 |     9 |     2   (0)| 00:00:01 |             
    |   8 |      TABLE ACCESS FULL     | SYS_TEMP_0FD9D6631_72948EFD |     1 |    39 |     2   (0)| 00:00:01 |             
    |   9 |    BUFFER SORT             |                             |     1 |     9 |     4   (0)| 00:00:01 |             
    |* 10 |     VIEW                   |                             |     1 |     9 |     2   (0)| 00:00:01 |             
    |  11 |      TABLE ACCESS FULL     | SYS_TEMP_0FD9D6631_72948EFD |     1 |    39 |     2   (0)| 00:00:01 |             
    Predicate Information (identified by operation id):                                                                    
       7 - filter(("WEEK1"."ITEM"=1 AND "WEEK1"."WEEK"=1))                                                                 
      10 - filter(("WEEK2"."ITEM"=1 AND "WEEK2"."WEEK"=2))                                                                 
    33 rows selected.
    mhouri > with week as ( select * from (select 1 item, 10 qty, 1 week from dual ))
      2        select /*+ no_query_transformation */
      3               main.item
      4             , week1.qty qty1
      5             , week2.qty qty2
      6          from week week1
      7             , week week2
      8             , ( select 1 item from dual ) main
      9         where main.item = week1.item (+)
    10           and week1.week (+) = 1
    11          and main.item = week2.item (+)
    12          and week2.week (+) = 2;
          ITEM       QTY1       QTY2                                                                                       
             1         10                                                                                                  
    mhouri > select * from table(dbms_xplan.display_cursor);
    | Id  | Operation                  | Name                        | Rows  | Bytes | Cost (%CPU)| Time     |             
    |   0 | SELECT STATEMENT           |                             |       |       |     9 (100)|          |             
    |   1 |  TEMP TABLE TRANSFORMATION |                             |       |       |            |          |             
    |   2 |   LOAD AS SELECT           |                             |       |       |            |          |             
    |   3 |    VIEW                    |                             |     1 |     9 |     2   (0)| 00:00:01 |             
    |   4 |     FAST DUAL              |                             |     1 |       |     2   (0)| 00:00:01 |             
    |*  5 |   HASH JOIN OUTER          |                             |     1 |    21 |     7  (15)| 00:00:01 |             
    |*  6 |    HASH JOIN OUTER         |                             |     1 |    12 |     5  (20)| 00:00:01 |             
    |   7 |     VIEW                   |                             |     1 |     3 |     2   (0)| 00:00:01 |             
    |   8 |      FAST DUAL             |                             |     1 |       |     2   (0)| 00:00:01 |             
    |*  9 |     VIEW                   |                             |     1 |     9 |     2   (0)| 00:00:01 |             
    |  10 |      TABLE ACCESS FULL     | SYS_TEMP_0FD9D6630_72948EFD |     1 |     9 |     2   (0)| 00:00:01 |             
    |* 11 |    VIEW                    |                             |     1 |     9 |     2   (0)| 00:00:01 |             
    |  12 |     TABLE ACCESS FULL      | SYS_TEMP_0FD9D6630_72948EFD |     1 |     9 |     2   (0)| 00:00:01 |             
    Predicate Information (identified by operation id):                                                                    
       5 - access("MAIN"."ITEM"="WEEK2"."ITEM")                                                                            
       6 - access("MAIN"."ITEM"="WEEK1"."ITEM")                                                                            
       9 - filter("WEEK1"."WEEK"=1)                                                                                        
      11 - filter("WEEK2"."WEEK"=2)                                                                                        
    36 rows selected.Best regards
    Mohamed Houri

  • Need help on where to post

    Can someone point me in the right direction of where to post a problem I have been having. With two different monitors, an apple VGS and a Viewsonic flatscreen, my displays have a fragmented image after going into sreensaver mode. I have searched under keywords "display - monitor, fragmented - image" and can't find anything remotely near my problem. Any suggestions on where to post this or look? Affected - B&W G3/10.3.9 + 9.2.2
    sarahj

    if it happens with two different monitors, and only occurs when the screensaver kicks in, and does NOT happen if you boot in os9 as opposed to running under osx classic, then i'd assume it's a software issue and post in the pre-10.4 osx forum...
    http://discussions.apple.com/forum.jspa?forumID=745
    if it happens no matter which os you boot from then i'd assume a hardware issue and post in the appropriate forum for your g3 system...
    http://discussions.apple.com/category.jspa?categoryID=105

  • Need help to where small sql query

    { names           numbers                         types
    id | name | | id | phone | who | type | | id | type |
    | 1 | jenny | | 1 | 867-5309 | 1 | 3 | | 1 | home |
    | 2 | tom | | 2 | 555-1212 | 3 | 1 | | 2 | cell |
    | 3 | smith | | 3 | 364-4311 | 3 | 2 | | 3 | work |
    | 4 | amy | | 4 | 936-2828 | 4 | 3 | | 4 | fax |
    | 5 | 525-8722 | 3 | NULL | -----------
    i am trying to get out put like this ,:
    name type phone
    | smith | home | 555-1212 |
    | smith | cell | 364-4311 |
    | smith | NULL | 525-8722 |
    is it posiible to get tree time "smith " in the name column ,that is confusing me a lot
    please can any one give idea how to solve this }
    Edited by: user4463478 on May 20, 2009 5:38 PM
    Edited by: user4463478 on May 21, 2009 11:51 AM
    Edited by: user4463478 on May 21, 2009 11:52 AM

    What is your table structure? It is confusing. Post your sample input, output, table strucutre etc between {noformat}{noformat} and {noformat}{noformat}
    And it looks like this.
    and Cheers
    Sarma.

  • Dynamic itab with Dynamic Where clause

    Hi, Dear All,
    Can someone provide a code extract for Dynamic where clause, i had already done with dynamic itab for a given set of fields, and i need to add where clause dynamically for a given field for a given range of values.
    select (i_fields) into table <dyn_table>
                      from (p_table)
                     where (v_where).
    In the above except the where clause, everything is done. Please help me.
    with best regards
    Mahesh

    Hi,
    here is the code extract for your reference.Pl. correct me.
    with regards
    REPORT  Z_DYN_ITAB                              .
    TYPE-POOLS: SLIS.
    DATA:NAME(100) TYPE C.
    TYPES: BEGIN OF ITAB_TYPE,
            WORD(20),
          END   OF ITAB_TYPE.
    DATA: ITAB TYPE STANDARD TABLE OF ITAB_TYPE WITH HEADER LINE.
    DATA: vg_fields(255) TYPE c,
          i_fields LIKE TABLE OF vg_fields.
    DATA: it_fcat TYPE slis_t_fieldcat_alv,
          is_fcat LIKE LINE OF it_fcat,
          ls_layout TYPE slis_layout_alv.
    DATA: it_fieldcat TYPE lvc_t_fcat,
          is_fieldcat LIKE LINE OF it_fieldcat.
    field-symbols: <dyn_table> type standard table,
                   <dyn_wa>,
                   <dyn_field>.
    data: dy_table type ref to data.
    data: dy_line type ref to data,
          xfc type lvc_s_fcat.
    DATA: v_where TYPE string, " Variable for storing where clause.
          v_dynamic(18) TYPE c, "variable to store select option datatype
          o_field TYPE REF TO cx_root," object to catch exception
          text TYPE string. "string variable to store exception text.
    CONSTANTS: c_var(15) TYPE c VALUE ' IN S_RANGE'.
    selection-screen begin of block b1 with frame.
    parameters: p_table(30) type c default 'T001',
                p_name(100) type c,
                p_field(10) TYPE c. " Parameter to capture field name.
    SELECT-OPTIONS: s_range FOR v_dynamic. " Select-option for range.
    selection-screen end of block b1.
    start-of-selection.
    NAME = p_name.
    SPLIT NAME AT ',' INTO TABLE ITAB.
    LOOP AT ITAB.
    is_fcat-fieldname = itab-word.
    is_fcat-tabname = p_table.
    APPEND is_fcat to it_fcat.
    ENDLOOP.
    LOOP AT it_fcat INTO is_fcat.
      is_fieldcat-fieldname = is_fcat-fieldname.
      is_fieldcat-tabname = is_fcat-tabname.
      APPEND is_fieldcat TO it_fieldcat.
      CONCATENATE is_fieldcat-tabname is_fieldcat-fieldname INTO
            vg_fields SEPARATED BY '~'.
      APPEND vg_fields TO i_fields.
    ENDLOOP.
    perform create_dynamic_itab.
    perform get_data.
    Create dynamic internal table and assign to FS
    form create_dynamic_itab.
    call method cl_alv_table_create=>create_dynamic_table
    exporting
    it_fieldcatalog = it_fieldcat
    importing
    ep_table = dy_table.
    assign dy_table->* to <dyn_table>.
    Create dynamic work area and assign to FS
    create data dy_line like line of <dyn_table>.
    assign dy_line->* to <dyn_wa>.
    endform.
    form get_data.
    Select Data from table.
    CONCATENATE p_field c_var INTO v_where.
    TRY.
    select (i_fields) into table <dyn_table>
                      from (p_table)
                     where (v_where).
    if sy-dbcnt = 0.
    write : text-t02.
    endif.
    *Write out data from table.
    Loop at <dyn_table> into <dyn_wa>.
    do.
    assign component sy-index of structure <dyn_wa> to <dyn_field>.
    if sy-subrc <> 0.
      exit.
    endif.
    if sy-index = 1.
      write:/ <dyn_field>.
    else.
      write: <dyn_field>.
    endif.
    enddo.
    endloop.
    Exception Catching.
    CATCH cx_root INTO o_field.
    text = o_field->get_text( ).
    Calling Function to give information message regarding Exception
    CALL FUNCTION 'POPUP_TO_INFORM'
    EXPORTING
    titel = text-t03
    txt1 = text
    txt2 = text-t04.
    TXT3 = ' '
    TXT4 = ' '
    LEAVE TO LIST-PROCESSING.
    ENDTRY.
    endform.

Maybe you are looking for

  • New major release, JE 5.0, is available

    Hi all, We're pleased to announce a new major release, JE 5.0.34. The release contains a significant number of new features and performance enhancements. Complete information can be found in the JE documentation, specifically in the change log. The r

  • Problem in loading a class from server

    hello, Please help me ,i m using this code to load a class from server and this code load this successfully but i don't how to make object of class that is just loaded. i want to load the class and use its method in my program please help me i m in v

  • HT1926 Upgrade Installation Problems

    The latest version of iTunes for Windows (XP) wouldn't download. Went through all the steps on the support page. Uninstalled/reinstalled iTunes. Now I get a message it couldn't read my library because it was created with a "newer" version of iTunes.

  • Screen detection in clamshell mode problems

    I have a weird issue with clamshell mode in Lion 10.7.2 Hardware: MacBook Air 13" i5 1.7, Apple Cinema Display 30" connected with Apple Mini DisplayPort to Dual-Link DVI adapter. Normally I use the computer in clamshell mode, with the laptop lid clos

  • App Refund Possibility

    Is it possible to get a refund for a very buggy App from Apple?