query with outer join not dispalying the correct results

Hi all

I have a table that has a column called State it may be null or has the code that comes from the research b.When I use this query
Select a b.menaing
where a.status = b'lookup_code (+)
AND b.lookup_type = 'MTH_BUSINESS_FUNCTION'
AND b.LANGUAGE = USERENV ('LANG')

so I don't understand the lines of table a, where the status is null

and if I use the condition:
Select a b.menaing
where ((a.status IS NULL) OR)
(a.status = b.lookup_code
AND b.lookup_type = 'MTH_BUSINESS_FUNCTION'
AND b.LANGUAGE = USERENV ('LANG')))

Then, I get a lot of additional lines. You can soemone please tell me hwo to do (my query should display the menaing if the status column is empty, then it must show empty if not after to join the lookup table, it should show some sense)

I don't get the rows in the table a, where the status is null

You must outerjoin each predicate referencing table b.:

select  b.menaing
  from  a,b
  where a.status=b.lookup_code(+)
    AND b.lookup_type(+)='MTH_BUSINESS_FUNCTION'
    AND b.LANGUAGE(+) = USERENV('LANG')
/

Or use:

select  b.menaing
  from  a left join b
    on  a.status=b.lookup_code(+)
    and b.lookup_type='MTH_BUSINESS_FUNCTION'
    and b.LANGUAGE = USERENV('LANG')
/

SY.

Tags: Database

Similar Questions

  • CF do not return the correct results

    I have a column that has positive and negative numbers and I'm trying to separate these numbers in a separate column for each. "My code below works if each barcode has both a positive and negative number to compare, but mistakes lifted as"cannot convert"numerical value" if I just all the positive numbers in the colum. Which, in some casees, I get because I import a CSV file. Can someone help with the code? -Thank you.

    <! - SUM POSITVE AMOUNT - >
    < cfquery name = "SumPositiveTemp" datasource = "inventory" >
    SELECT the barcode, Sum (Quantity) as quantitysumPositive
    TEMP
    WHERE quantity > 0
    GROUP BY barcode
    < / cfquery >

    <!--> SUM QUANTITY NEGATIVE
    < cfquery name = "SumNegativeTemp" datasource = "inventory" >
    SELECT the barcode, Sum (Quantity) as quantitysumNegative
    TEMP
    WHERE quantity < 0
    GROUP BY barcode
    < / cfquery >

    <!-SUBTRACT QUANTITY ISSUED LESS QUANTITY RECEIVED IN QUANTITY SOLD-> GET
    < cfset QuanitySold = ' #SumPositiveTemp.quantitysumPositve - SumNegativeTempquantitysumNegative #' >

    <! - INSERT POSITVIE/NEGATIVE NUMBERS INTO TABLE - >
    < cfoutput query = "SumPositiveTemp" >
    < cfquery name = "InsertPositiveIntoCart" datasource = "inventory" >
    INSERT INTO Cart1 (barcode, QuantityOut, QuantityIn, QuantitySold)
    VALUES (#SumPositiveTemp.barcode #, #SumPositiveTemp.quantitysumPositive #, #SumNegativeTemp.quantitysumNegative #, #QuantitySold #)
    < / cfquery >
    < / cfoutput >

    Yes, I found that if the barcode was not POS and NEG numbers it returns a null value. After more research, I found that was the solution to avoid a null value and use in this situation.

  • Outer join is not retrieve the correct values

    Hi, I have a problem to recover some data from this query with outer join:

    SELECT count (incident_id), range_2 of
    (by selecting range_2 in apps.aaa_table),
    (Select inc.incident_id,
    XXN2B_RESOLUTION_RANGE (2, ROUND (((TO_DATE (inc. INCIDENT_ATTRIBUTE_7, «hh24:mi:ss jj/mm/yyyy»)-inc. INC_RESPONDED_BY_DATE) * 24), 2)) VARIES
    Inc. stuff
    Inc. INVENTORY_ITEM_ID,
    prom_dt. Iptv_Sumptom - S? µpt? µA
    OF cs_incidents_all_b inc.,.
    cs_incidents_all_tl tl,
    cs_sr_type_mapping m,
    fnd_responsibility RESP,
    ntt xxntt.xxntt_incidents_support,
    xxntt.xxntt_incidents ntt_inc,
    XXe.xxe_tt_promitheas_dt prom_dt,
    20th. Xxe_Cs_Int_Sla als
    WHERE inc.incident_id = tl.incident_id
    AND tl. LANGUAGE = 'EL '.
    AND inc.incident_type_id = m.incident_type_id
    AND resp.responsibility_key IN (select SV. S fnd_flex_value_sets FLEX_VALUE, FND_FLEX_VALUES SV
    where s.FLEX_VALUE_SET_NAME = 'XXNTT_RESPONSIBILITIES. '
    AND S.FLEX_VALUE_SET_ID = SV. FLEX_VALUE_SET_ID)
    AND m.responsibility_id = resp.responsibility_id
    AND resp.end_date is null
    AND inc.incident_number = ntt.incident_number (+)
    AND inc.incident_number = ntt_inc.incident_number (+)
    AND inc.incident_id = prom_dt.incident_id (+)
    AND inc.incident_number = sla. Incident_Number (+)
    - and don't like '%0:00% ' TOTAL_INACT_SLA_DURATION
    (Inc. INC_RESPONDED_BY_DATE is not null AND INCIDENT_ATTRIBUTE_7 is not null)
    ) b.
    (select * from xxntt_custom_hierarchy)
    Union
    Select eidos null null omada, null product_categiory, stuff, null, null, inv_item_descripiption, null, tautopoihsh, inv_item_id double null null symptom
    ) c
    where a.range_2 = b.ranges (+)
    and c.INV_ITEM_ID (+) = b.INVENTORY_ITEM_ID
    and c.CATEGORY_ID (+) = b.CATEGORY_ID
    and c.SYMPTOM (+) = b.IPTV_SUMPTOM
    and c.OMADA = 'A '.
    Range_2 group

    This request is composed by 3 dataset: a, b and c

    the data group is a fixed list of values (LOV): range_2 = "0-2h','2-4h','4-6h','6-8h','8-10h','10-12h','12-14h','14-16h','16-18h','18-20h".

    the dataset b retrieve a list of the incident_id and their related ranges (calculated with the XXN2B_RESOLUTION_RANGE function)

    the c dataset is just a filter on the b of dataset to retrieve only the incident_id who belong to the group "A".

    I want to reach is this: always see the full list of values 'range_2', even if I do not have incident_id with a particular range.
    That's why I put the condition: a.range_2 = b.ranges (+)

    .. .but it does not work... I don't see the incident_id which have the scope inside the LOV... instead I want to see also if there is incident_id without a range to the LOV.

    Range_2 grouping, I see:

    ! http://www.freeimagehosting.NET/uploads/d900035c11.jpg!


    Instead of

    ! http://www.freeimagehosting.NET/uploads/99a75dfca4.jpg!

    Can someone help me understand where is the error?

    Thanks in advance

    Alex

    Hi Alex,

    I think you need to externally join the final predicate, thus:

    ..
    and c.OMADA(+) = 'A'
    ..
    

    Concerning
    Peter

  • How create/update files when the original Version is based on a query of outer join?

    Hi gurus,


    I created a custom page where I use a table-style area where I question my VO records, based on a query of outer join. This query contains my table looks, where I would like to insert/update records, and joined the table of standard elements, which is external with my custom table.

    When I now question my files in the t, I have a record for each record in the table section, which is ok, but when I 'Refresh' some fields of my custom table and attempt to commit, I get the message "unable to complete the transaction on record. Cause: The record has been deleted by another user. "Action: cancel the transaction and re - query records to get new data.
    The reason why because a record is to be inserted rather than updating because in fact there is not yet in my custom table.

    The reason why I'm using the outer join, is because I don't want the user to create a record for each item one by one.
    There is no work around for this?

    Thanks in advance!


    BR
    Guy

    Hello
    You can try this.

    In your EntityImpl.java to extend OAPlsqlEntityImpl.

    Override the updateRow() method and coding your insert statement to insert into a table custom here.
    Don't forget, you must ignore the lines for which your custom table columns are null

    -Idris

  • outer join does not give the expected results (missing documents)

    Hello
    I have problem with outer join in OBIEE 10 g.

    I'm testing it on the model of simplified database

    STAT table with some statistics of TYPEs
    stat_date, id_type, num
    ..
    ..
    26/03/2003, 20: 1
    26/03/2003, 21: 1
    26/03/2003, 23: 1
    26/03/2003, 24, 1
    26/03/2003, 25, 1
    ..
    27/03/2003, 22, 1 <-different date here
    ..
    ..

    Table TYPES
    ID_type
    ..
    ..
    20
    21
    22
    23
    24
    25
    ..
    ..


    Physical model
    STAT >-TYPES


    AM.
    F1 (only Digital STAT table column (agg. County))
    D1 (STAT_DATE of the STAT table column only)
    D2 (source TYPES)

    D1 - inner join - < F1
    D2 - left outer join - < F1


    I would like to create simple report filtered by date with number of each type.
    I want to get this result
    ID_type County
    ..     ..
    ..     ..
    20 1
    21 1
    22 null
    23 1
    24 1
    25 1
    ..     ..
    ..     ..


    But I get this
    ID_type County
    ..     ..
    ..     ..
    20 1
    21 1
    23 1
    24 1
    25 1
    ..     ..
    ..     ..

    ID_type 22 is missing


    !!!

    I NORMALLY GET RESULT ONLY IF I DELETE RECORD ' 27/03/2003 22' OF MY FACT TABLE.

    !!!


    I have the filter on the date column D1
    STAT_DATE = 26/03/2003 or STAT_DATE is null


    BI Server running this SQL query


    Select distinct D1.c1 as c1,
    D1. C2 C2
    Of
    (select count (T17840. NUM) in c1.
    T17867.ID_TYPE C2
    Of
    Left outer join of TYPES T17867
    STAT T17840 on T17840.ID_TYPE = T17867.ID_TYPE
    where (T17840. STAT_DATE in (TO_DATE ('2003-03-26', 'YYYY-MM-DD')) or T17840. STAT_DATE is null)
    T17867.ID_TYPE group
    ) D1


    Can you give me some advice?

    Thank you

    Hi cardel,

    I think that you can achieve your goal if you build a dimension of the array STAT form, you can create a table Alias in the physical layer and then to join the table of facts (external to the left). In this way, I think that you can solve your problem.

    Let me know.

    Kind regards
    Gianluca

  • BAD RESULTS WITH OUTER JOINS AND TABLES WITH A CHECK CONSTRAINT

    HII All,
    Could any such a me when we encounter this bug? Please help me with a simple example so that I can search for them in my PB.


    Bug:-8447623

    Bug / / Desc: BAD RESULTS WITH OUTER JOINS AND TABLES WITH a CHECK CONSTRAINT


    I ran the outer joins with check queries constraint 11G 11.1.0.7.0 and 10 g 2, but the result is the same. Need to know the scenario where I will face this bug of your experts and people who have already experienced this bug.


    Version: -.
    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    PL/SQL Release 11.1.0.7.0 - Production
    CORE    11.1.0.7.0      Production
    TNS for Solaris: Version 11.1.0.7.0 - Production
    NLSRTL Version 11.1.0.7.0 - Production

    Why do you not use the description of the bug test case in Metalink (we obviously can't post it here because it would violate the copyright of Metalink)? Your test case is not a candidate for the elimination of the join, so he did not have the bug.

    Have you really read the description of the bug in Metalink rather than just looking at the title of the bug? The bug itself is quite clear that a query plan that involves the elimination of the join is a necessary condition. The title of bug nothing will never tell the whole story.

    If you try to work through a few tens of thousands of bugs in 11.1.0.7, of which many are not published, trying to determine whether your application would be affected by the bug? Wouldn't be order of magnitude easier to upgrade the application to 11.1.0.7 in a test environment and test the application to see what, if anything, breaks? Understand that the vast majority of the problems that people experience during an upgrade are not the result of bugs - they are the result of changes in behaviour documented as changes in query plans. And among those who encounter bugs, a relatively large fraction of the new variety. Even if you have completed the Herculean task of verifying each bug on your code base, which would not significantly easier upgrade. In addition, at the time wherever you actually performed this analysis, Oracle reportedly released 3 or 4 new versions.

    And at this stage would be unwise to consider an upgrade to 11.2?

    Justin

  • Can not find the correct driver in Macbook - J4680c

    Hello!

    just install a print server on the network from my boss - netgearPS121v2.  everything is great with 2 Mac and a PC - everything can print, etc.

    all the macs print to print IP assistance and the appropriate driver.  for some reason, my boss pro macbook did not have the correct driver installed and all that is available to him is "HP Officejet J4680 series - Fax" that does not work.  I use the same macbook pro with the same system (10.6) and did not have a problem.  his machine was the Guinea pig for his assistant try to set up while on the phone with HP tech support.  (I was out of town and unable to install).  I have a feeling that this was an inadequate installation and hampered by technical support, try to fix it.

    any suggestions on how to completely uninstall the HP software so I can't completely re - install?

    Thank you!

    Steve

    Well Yes,.

    I guess that someone loaded the HP from the CD for the printer software (which is only 10.5 or earlier version).  Here's how to correct:

    Go to Applications/Hewlett Packard / click Uninstall HP
    Click on continue
    Highlight your device in the left pane
    Hold down the Ctrl and Opt Cmd and click on uninstall
    There will be a pop up that asks if you are sure you want to uninstall all hp software. (At this point, if you continue, all HP printers you have installed will need to be reinstalled)
    Click on continue and let it finish

    Now run a software update.

    Then, remove and reinstall the printer in System Preferences, Print & Fax.

    You do not have the software now since Snow Leopard as well print & scan drivers built-in. scan from Preview apps or Image Capture. Scan from the front panel of the printer does not work yet.

  • I am trying to install a D-Link router, but it will not designate the correct IP address.

    Im trying to install a d-link router and it will not get the correct ip address. I then tested on my roommates with a newer version of windows laptop and the router has worked. d-link technology says I may new new setting lan drivers installed for this problem. help someone?

    original title: router problems

    Make sure that this adapter you set obtain IP and DNS addresses automatically.  Go to your network connections and right click on your internet connection and select 'Properties', then click on (highlighted) Protocol Internet (TCP/IP) and then click on the properties button and make sure that the IP address and DNS are both set to obtain automatically addresses.

    Go to the Services management console (type services.msc in the box run from the start menu) and make sure that the DHCP Client service is set to automatic startup.  Restart the computer and see if things improve.

    John

  • Windows Media Center EPG does not have the correct data

    Windows Media Center EPG on my computer is so ugly!

    Description is separated in two, and it's always the last part that displays first, so you'll have to roll down to the bottom to read the description.

    The series is difficult to use, because the series 1) is not always marked as series (so you can select 'plain' Record), and 2) the title contains often series of numbering (e.g. "the bodyguards (1:6)"), so even if it is marked as a series, it will record ever "Guards body (2:6)" or other titles (the Media Center will just try to record any episode of "Bodyguards (1:6)").

    It is the broadcaster who create * data, and then displays in Media Center via Broadcasting Dataservices Ltd., or who are the last to blame?

    What is MS Media Center that does not have the correct data?

    I am in Denmark, if this has an impact on the response.

    Thank you and best regards!

    Hello

    Thank you for your response. I appreciate your time.

    I suggest you to post your query on our MSDN Forums, as this issue should be better there.

    Please refer to the reference to the link below to send your request:

    http://social.msdn.Microsoft.com/forums/en-us/home

    Hope this information helps.

  • GetDeviceCaps does not give the correct pixel factor in windows 7.

    GetDeviceCaps does not give the correct pixel factor in windows 7, if I use 96 dpi settings means it gives the pixel as 1 factor and if I user the 120 dpi settings means that he must give the factor 1.25 pixel, in windows xp, I had good factor with GetDeviceCaps but in window7, it returns 1 instead of 1.25 pixel factor can someone help me with this problem

    ScreenDPI.x = GetDeviceCaps (ScreenDC, LOGPIXELSX);
    float PixelX = (float) ScreenDPI.x/96;

    Hello

    I would like you to post your question in the TechNet forum.

    http://social.technet.Microsoft.com/forums/en-us/w7itproui/threads

    I hope this helps.

  • Present do not get the correct values

    Apex 4.2

    THAT IS TO SAY 8

    Theme 21

    I just upgraded a request from 3.2 to 4.2

    A page has had a lot of text to read only the value always.

    A running a process I got this error

    So I put my items to display only and read to null

    When the page opens all values are set correctly in session state

    My process works well, but when the process terminates and then check out the session state, my articles do not receive the correct values

    I looked into debugging accept

    All ideas

    Gus

    I changed all my articles to text, but after sending, they continue to receive the false values

    Gus

  • When I uninstall an application virtualized with ThinApp does not eliminate the root folder, any suggestions to fix this?

    When I uninstall an application virtualized with ThinApp does not eliminate the root folder, any suggestions to fix this?

    Can you try to change the shortcuts = active on all entry Points setting?

    Change of Shortcuts=%Programs%\Check Point\Identity Shortcuts=%Programs%\IdentityAgent Agent

    In this way, we can see if it's the second folder level do. Because when I use only one file, I don't get the issue you reported.

    Out of curiosity:

    It is a Security Check Point Software? What is doing? It works like a ThinApp package?

  • Is there a parameter that allows to convert customer vectorized on work type supplied when we do not have the correct fonts in our system?

    Is there a parameter that allows to convert customer vectorized on work type supplied when we do not have the correct fonts in our system?

    Try to place the linked files as an object, and then do > flatten transparency with the appropriate settings.

  • Animate FancyBox iframe in Edge - do not show the correct height and width

    Hi all

    Can someone please provide advice or a solution to this problem.

    I tried to use the edge Fancybox.js animate to call an iframe (as a pop up album).

    However when I try this it does not show the correct height and width properties - even though I am their definition.

    When I test this on my hard drive it works fine in Chrome and Firefox. But when tried on line on a test server I get a slim pop up that has not properly set the height.

    Would be - because the iframe is pre-configured before composition/html page first affecting the size?

    Help, please

    CODE USED:

    $. fancybox.open)

    {

    type: "iframe"

    autoScale: 'false. '

    height: '600'.

    Width: '600',

    HREF: 'llink.htm site publication. "

    }, {

    padding: 0

    });

    Other references: http://businessanywhere.biz/blog/2013/03/adding-a-lightbox-to-edge-animate/

    See you soon,.

    Jason

    HI koyissa,

    Thank you for your response to this.

    I worked on what was the problem - my external publication that was created to animate dashboard was centered horizontally and vertically.

    He created the problem. When I took this out of the box of fancy worked well.

    See you soon,.

    Jason

  • Adobe Acrobat 8 Professional does not have the correct serial number after reinstalling

    Adobe Acrobat 8 Professional does not have the correct serial number after resettlement, what to do?

    Open one of the other products first (like PhotoShop and make sure that they are turned on.) Leave it open and launch Acrobat. You may need to reactivate Acrobat can. There is a difference that CS and CC seem to use requiring a such a step with Acrobat. For more information, you can ask in the CC forum because the installation is a little different from the standalone Acrobat.

Maybe you are looking for

  • Please have a tech call me; I can't follow the instructions for the use of bookmarks. Thank you. Joyce H.

    I'm unable to put various information. in my list of bookmarks/favorites. Edit: removed personal information for your protection. Please note that we cannot offer support by telephone, so please continue in the forum. Thank you for your understanding

  • Windows Update error 80245006

    I have HP Pavilion 15 - N208TX. My Windows Update shows error: 80245006. Please help me with this problem. System details: 8.1 Windows x 64

  • NEED A HP SOFTWARE OR DRIVER TO RUN WEBCAM.

    Hello I HAVE A COMPAQ PRESARIO CQ42-173TU. AND IN IT, I INSTALLED WINDOWS 7 ULTIMATE (32 BIT). HE BUILT THE WEB CAM (HP WEBCAM-101). YOU CAN GIVE ME PLS WITH HP SOFTWARE TO RUN MY WEBCAM. Thank you PRESARIO CQ42-173TU, processor intel core i3 - 330 m

  • copy destination not on the screen of the printer HP 7525

    "This computer copy" my office computer name does not appear as a choice on the printer screen, while my laptop name appears as a choice. I might cause the installation of HP 7525 on the desktop pc since I chose to do just install from the installati

  • N5k and FI send syslog

    Hi, I would like to know the behaviuor N5ks and the FIs when they send syslog messages to multiple remote syslog servers. They send it to the 1st in the list OR all the at the same time. If I 'logging server' on the n5k, it shows me 3 BUT as I do not