Need help with joins Oracle


Hi all

Any new on Oracle Sql and I need expert input to solve a problem I have to join Oracle.

Have a requirement as below, my reading of request as below.

SELECT A.GCI, B.LOB_IND, B.CED_ID, C. LOB_DESCR OF CUSTOMER, CUSTOMER b, C from LOB

WHERE A.PRIMARY_CED = B.CED_ID (+)

AND B.LOB = C.LOB_DESCR (+)

AND B.LOB_IND (+) = 'Y '.

AND A.GCI IN

(

'339492963',

'339850821');

Output current:

GCI LOB_IND CED_ID LOB_DESCR

339850821 Y 7905108 banking services for businesses

Null Null null 339492963

Power required:

GCI LOB_IND CED_ID LOB_DESCR

339850821 Y 7905108 banking services for businesses

339492963 7859659 null null

In the table B (CLIENT) for a ced_id there will be several entries.

Select ced_id, LOB_IND from CLIENT b where b.ced_id = '7905108';

ced_id LOB_IND

7905108 IS

7905108 null

7905108 null

Select ced_id, LOB_IND from CLIENT b where b.ced_id = 7859659;

ced_id LOB_IND

7859659 null

7859659 null

so when writing of the main request, I took B.LOB_IND (+) = 'Y' condition, since I added this condition and catches of outer join.

the ced_id for "7859659" is not coming in the query below.

SELECT A.GCI, B.LOB_IND, B.CED_ID, C. LOB_DESCR OF CUSTOMER, CUSTOMER b, C from LOB

WHERE A.PRIMARY_CED = B.CED_ID (+)

AND B.LOB = C.LOB_DESCR (+)

AND B.LOB_IND (+) = 'Y '.

AND A.GCI IN

(

'339492963',

'339850821');

Output current:

GCI LOB_IND CED_ID LOB_DESCR

339850821 Y 7905108 banking services for businesses

Null Null null 339492963

Is it possible that the query can be modified to get the below output with CED_ID for B.LOB_IND-> case of Null.

Power required:

GCI LOB_IND LOB LOB_DESCR

339850821 Y 7905108 banking services for businesses

339492963 7859659

Your entered very necessary.

Thank you

Be great if someone could have provide some suggestions.

Use ANSI joins:

SELECT A.GCI, B.LOB_IND,
B.CED_ID,
C.LOB_DESCR
CUSTOMER A
LEFT JOIN
CLIENT b, C from LOB
ON)
A.GCI IN)
'339492963',
'339850821'
)
AND
A.PRIMARY_CED = B.CED_ID
AND
B.LOB_IND = 'Y '.
)
LEFT JOIN
C LOB
ON)
B.LOB = C.LOB_DESCR
)
/

SY.

Tags: Database

Similar Questions

  • Need help with some oracle basics

    Hi friends,

    I would like to know if my abt to understand some concepts as described below is just?

    1) active user : when a user issues a command SQL to oracle to perform.

    (2) * user inactive: * when oracle wait for users to issue commands and the user is INACTIVE.


    Please help me to find these answers:

    A user become active when they click submit button/backup/restore?

    I would like to know how much resources a user oracle uses (network traffic, memory, I / O)?

    Is a user uses some resources if it is inactive and sitting idle for long time?



    Thank you

    Oracle marks a session as a session inactive if the user will not do anything with the database for some time. I don't know what is the explanation for the status of the session that you see a toad, since I do not use it. Maybe someone else would have a better explanation then wait for others to participate.

    Aman...

  • Need help with join

    I have a problem with the join, I try to use it to eliminate the mass number of path layers and sublayers I. Everything is already connected by anchor point but they have all of the separate layers and it is heavy for shipping and export.

    Here's what I want to join, lines are in place and, even once, the anchor points are connected. I want to keep this form:

    Untitled.jpg

    And that's what he keeps to:

    Untitled 2.jpg

    Any suggestion is welcome.

    dmuir,

    You can reach only two segments of track at the same time, so that each (no end) Anchor Point has only two adjacent segments.

    You can combine paths and creating paths compound and other things, but you're stuck with a number of roads as building blocks.

  • Need help with the Oracle error table

    Hello

    I'm procedures for migration from SQL server to Oracle.

    In SQL server there is a reference to the table * master.dbo.sysmessages * is there any table in oracle, which equals master.dbo.sysmessages table of SQL server.

    Thanks in advance.

    Hello

    In sql server, the view is not containing error details.., I think that there is no such a table in oracle... To do this use the SQLERRM function in oracle...

  • Need help with the IP configuration on vm ware for the installation of 11 GR 2 on linux vmware 6 on win7

    Need help with the ip configuration on/etc/hosts for the installation of 11 GR 2 on linux vmware 6 on win7.

    Let me know if you need more info... in fact I have a setting error while installation said

    -(/ etc/hosts has no correct entry for the host name)

    Host: 192.168.85.100

    Win7 ip: 192.168.1.x

    Thank you...

    (host computer)

    Win7 64 bit

    (vmware)

    Oracle Linux Server 6.3 version

    Release of Red Hat Enterprise Linux Server 6.3 (Santiago)

    Oracle Linux Server 6.3 version

    -(/ etc/hosts has no correct entry for the host name)

    Then post your/etc/hosts.

    Host: 192.168.85.100

    Win7 ip: 192.168.1.x

    Why 85? have you tried 192.168.1.100?

  • Need help with SQL/PL/SQL for Dates

    Hi Experts - need help with a SQL query.

    I need to insert some date fields in a table called CALENDAR_PERIOD.

    Current data in CALENDAR_PERIOD table with their data types:

    STARTPERIOD (DATE) YEAR (NUMBER) PERIOD_LABEL (Varchar2 255)

    02/11/2014 2014 2014/02/11 SUN

    03/11/2014 2014 14/03/11 MON

    04/11/2014 2014 11/04/14 MAR

    I have to increment above values up to the year 2025. I don't know how to write SQL and increment of these values.

    Ex: My next value should insert: 05/11/2015 2014 11/05/14 WED like that I need to insert data until 12 31, 2025.

    Can you please help me with PL/SQL block?

    Really appreciate your help!

    DB version:

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    CORE Production 11.2.0.3.0

    AMT for IBM/AIX RISC System/6000: Version 11.2.0.3.0 - Production

    NLSRTL Version 11.2.0.3.0 - Production

    Thank you
    Sandy

    Hello Sandy,

    Maybe something like

    INSERT INTO calendar_period (startperiod, year, period_label)

    SELECT DATE '' 2014-11-04 + LEVEL

    , TO_NUMBER (TO_CHAR (DATE '' 2014-11-04 + LEVEL, "YYYY"))

    , TO_CHAR (DATE '' 2014-11-04 + LEVEL, "MM/DD/YY DY")

    OF the double

    CONNECT BY LEVEL<= date="" '2025-12-314="" -="" date="">

    ;

    ((mais je ne comprends pas pourquoi nous créons une telle table "année" et "period_label" peuvent être calculé à partir de startperiod))

    Best regards

    Bruno Vroman.

  • Need help with a query result

    Oracle Version: 11.2.0.2.0

    I need assistance with the output of the query. Here is the table.

    With Tbl_Nm as

    (

    Select 'ABC1' SYSTEM_ID, REGION 'US', 'CHI' SUB_REGION 4000 BALANCE, to_date('1-JUN-2012 10:45:00 am', 'dd-mon-yyyy hh:mi:ss am') LAST_UPD_TIME, 'A' FLAG of union double all the

    Select 'PQR2', 'UK', 'LN', 2000, To_Date('1-JUL-2012 10:46:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' starting from dual Union All

    Select 'ABC1', 'IND","MAMA", 3500, To_Date('1-AUG-2012 11:47:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select "LMN3", "US", "NJ", 2500, To_Date('1-SEP-2012 09:49:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select "PQR2", "UK", "MC", 2600, To_Date('1-OCT-2012 04:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select 'ABC1', 'US', 'NY', 3200, To_Date('1-OCT-2012 06:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' starting from dual Union All

    Select "LMN3", "UK", "BT", 2400, To_Date('1-NOV-2012 07:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' From Dual

    )

    Select * from tbl_nm

    I need the output below.

    PQR2 UK MC 2600 1 OCTOBER 2012 04:45

    ABC1 US NY 3500 October 1, 2012 06:45

    LMN3 UK BT 2500 November 1, 2012 07:45

    The need the disc according to this system_id flagged as "A". But if the last disc of 'd' then it must show that the amount, but the file should be displayed in 'A '.

    I've tried a few and got stuck. Help, please. Not able to get a balance '.

    This question is a bit similar to needing help with a query result

    With Tbl_Nm as

    (

    Select 'ABC1' System_Id, region 'US', 'CHI' Sub_Region, 4000 balance, To_Date('1-JUN-2012 10:45:00 am', 'dd-mon-yyyy hh:mi:ss am') Last_Upd_Time, 'A' flag of double Union All

    Select 'PQR2', 'UK', 'LN', 2000, To_Date('1-JUL-2012 10:46:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' starting from dual Union All

    Select 'ABC1', 'IND","MAMA", 3500, To_Date('1-AUG-2012 11:47:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select "LMN3", "US", "NJ", 2500, To_Date('1-SEP-2012 09:49:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select "PQR2", "UK", "MC", 2600, To_Date('1-OCT-2012 04:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), 'A' from dual Union All

    Select 'ABC1', 'US', 'NY', 3200, To_Date('1-OCT-2012 06:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' starting from dual Union All

    Select "LMN3", "UK", "BT", 2400, To_Date('1-NOV-2012 07:45:00 am', 'dd-mon-yyyy hh:mi:ss am'), has ' From Dual

    )

    Select System_Id, region, Sub_Region, Balance, Last_Upd_Time of Tbl_Nm T1

    where t1. Last_Upd_Time = (select max (Last_Upd_Time) in the Tbl_Nm T2 where T1.) SYSTEM_ID = T2. SYSTEM_ID)

    So maybe you'd then

    ORDER BY DECODE(flag,'D',9,1) ASC...

    to get the Ds at the end of the list.

    or

    ORDER BY CASE WHAT flag = has ' (your other filters) AND then 9 or 1 end CSA,...

    HTH

  • Need help to install Oracle Business Intelligence 11.1.1 Applications. 7.1

    Hello

    I intend to install some Applications Oracle Business Intelligence 11.1.1.7.1 in my machine. I need some clarification before you install it.

    (1) can I install and run unity of repository on the local computer (that is not a server)?

    (2) don't need an application server for the installation of the Oracle Applications Business Intelligence 11.1.1.7.1?  If so where should I install the server applications or server or in my local computer?

    Thanks in advance

    Here you go...

    (1) can I install and run unity of repository on the local computer (that is not a server)?

    Yes, you can, if you have a database and ongoing running and accessible from your machine.

    (2) don't need an application server for the installation of the Oracle Applications Business Intelligence 11.1.1.7.1?  If so where should I install the server applications or server or in my local computer?

    Yes you need, and it will be good to have it on your machine.

    Before installing, make sure that you have min 4 GB of ram to work actively on OBIEE.

    So useful mark...

    Let me know if you need help with the installation.

  • Urgent need help with String Manipulation

    Hello;
    I really need help with strings.

    Let's say I have these channels:
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz

    \\ABC\DEF\GHI\xyz\

    \\ABC\DEF\GHI\xyz\xyz\xyz\

    \\ABC\DEF\GHI

    \\ABC\DEF\GHI\

    ABC/DEF/GHI/xyz/xyz/xyz/xyz

    ABC/DEF/GHI/xyz /.

    ABC/DEF/GHI/xyz/xyz/xyz /.

    ABC/DEF/GHI

    ABC/DEF/GHI.

    I need to convert them using a SQL statement for:
    \\ABC\DEF\GHI\xyz\ or //ABC/DEF/GHI/xyz/ according to the original management / or \. Please note that the "xyz" may be repeated zero or more times. I just need one end with a trailing / or -if she had one first.

    I'm on Oracle 11.1.6 SE. I have a bunch of attempts with instr, substr and replace, but I think that regexp_replace could be better.
    Any help would be GREAT! I have a whole team waiting on me.

    Hello.

    Here is a way.

    -----------------------------------------------------------------------
    with sample_table as
    (
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\xyz' str from dual union all
         select '\\ABC\DEF\GHI\xyz\' from dual union all
         select '\\ABC\DEF\GHI\xyz\xyz\xyz\' from dual union all
         select '\\ABC\DEF\GHI' from dual union all
         select '\\ABC\DEF\GHI\' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/xyz' from dual union all
         select '//ABC/DEF/GHI/xyz/' from dual union all
         select '//ABC/DEF/GHI/xyz/xyz/xyz/' from dual union all
         select '//ABC/DEF/GHI' from dual union all
         select '//ABC/DEF/GHI/' from dual
    )
    select str,
         regexp_replace(str,'(xyz([/\])*)+$','\1') new_str
    from  sample_table;
    
    STR                      NEW_STR
    ------------------------------ ------------------------------
    \\ABC\DEF\GHI\xyz\xyz\xyz\xyz  \\ABC\DEF\GHI\xyz
    \\ABC\DEF\GHI\xyz\            \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI\xyz\xyz\xyz\     \\ABC\DEF\GHI\xyz\
    \\ABC\DEF\GHI                 \\ABC\DEF\GHI
    \\ABC\DEF\GHI\                 \\ABC\DEF\GHI\
    //ABC/DEF/GHI/xyz/xyz/xyz/xyz  //ABC/DEF/GHI/xyz
    //ABC/DEF/GHI/xyz/            //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI/xyz/xyz/xyz/     //ABC/DEF/GHI/xyz/
    //ABC/DEF/GHI                 //ABC/DEF/GHI
    //ABC/DEF/GHI/                 //ABC/DEF/GHI/
    

    Kind regards.

  • I'm suddenly needing help with my browser Firefox (6.0.2)

    Hello
    I'm suddenly needing help with my browser Firefox (6.0.2)

    (OS: I use Windows XP).

    When I open the browser, I don't see is a totally white screen of white, with all the toolbars at the top.

    I know that my physical connections are very good: I have tested the modem, turned the pc market etc and I can also receive/send emails.

    This problem started today, September 8, 2011 and has never happened before.

    Is it a coincidence that Firefox itself to day before I disconnected yesterday evening? Could this be something to do with this particular new update?

    I also noticed that just before I "opened" Firefox, I now get a small box indicating:

    [JAVASCRIPT APPLICATION]
    Handl exc in Ev: TypeError: this oRoot.enable is not a function

    This never appeared before - I hope that it offers a clue has what is wrong.

    The browser not be stuck in Mode safe, said by the way.

    Of course, I can't find solutions to the problem on the internet, I don't physically see all Web sites!
    (A friend sends this request in my name from their pc)

    Any light you can throw on this problem of confusion would be much appreciated. I'd rather not have to uninstall and reinstall Firefox if possible.

    If the only option is to uninstall Firefox and reinstall from your site, I'm also in trouble (I can not see the internet or download).
    In this case, would you be able to send the .exe file as an attachment to my e-mail address? In the affirmative, please let me know and I'll give you more details.

    Thanks in advance.

    One possible cause is security software (firewall) that blocks or limits Firefox or plugin-container process without informing you, possibly after the detection of changes (update) for the Firefox program.

    Delete all rules for Firefox in the list of permissions in the firewall and leave your firewall again ask permission to get full unlimited access to the internet for Firefox and the plugin-container and the update process.

    See:

    Start Firefox in Firefox to solve the issues in Safe Mode to check if one of the extensions of the origin of the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > appearance/themes).

  • Need help with installation on Photosmart C7280 all-in-one

    I had my printer is installed and has been using the printer for 3 wireless laptops in my house.  Now, I can't even find my backup drive, so I have need help with downloading the software to use my printer and also get to use wireless.   I don't know what happened, but the fax for this printer is listed, but not the printer itself.   Help, please!

    Click here to download the software for your printer:

    http://h10025.www1.HP.com/ewfrf/wc/softwareCategory?product=3204785 & LC = on & CC = US & DLC = in & lang = to & CC = US

    has chosen the appropriate operating system that corresponds to your computer and download the full software features.

  • HP laptop: need help with internet and search for things

    whenever I'm on chrome internet explore google ect and go to tab it is says unknown error or no internet connection or anything and just takes me chrome ect. I need help with this im involved in a byod class and my computer won't let me on what whatever usually it just starts out black and white and the seeds I my search request

    Yes it's a Windows 10 and it arrived already installed I'll take the other info now

  • Need help with the installation of an adapter of Palit GeForce 9500GT Super chart - 512 MB in a M2N68 (narrated

    Need help with the installation of an adapter of graphics Super Palit GeForce 9500GT - 512 MB - DDR2 SDRAM in a M2N68 motherboard (narra6). Should I disable the onboard graphics in the bios? When the card is installed, no VGA work outs and the PC does not start. Checked and recontroler implementation of the card in the PCI slot. PC is a desktop HP G5200uk PC. Windows 7 operating system.

    Hello

    The link below is a guige to install a video card in your Pc.  In particular, it seems that you will have to perhaps specify the location of the new card in the bios and save this change before you install the new card - see step 4 in the guide on the link below.  If your new card fits into the PCI Express x 16 slot, you will need to define PCI Express in the bios and save the changes.

    http://support.HP.com/us-en/document/c01700855

    Kind regards

    DP - K

  • need help with my window is in thai and I do not understand to all.how to convert to English?

    need help with my window is in thai and I don't quite understand.
    How to convert to English? I tried for days but still it cannot be changed.
    because I can't read thai... Please help me step by step...

    my pc is touchsmart 9100 windows 7 Professional.

    Not a single word is in English if I go to the "region and language" to change.

    Everthing is in thai in the system.

    Hello

    Where have you bought the PC?

    What is the operating system installed?

    Best regards

    ERICO

  • I need help with an installation failure to interpret and troubleshoot a Setup log.

    Background: A few years ago, many editors of cinema used Final Cut Pro 6 (also contained in Final Cut Studio 2) for their editing projects.  Shared Apple Final Cut X uses a different format that is not compatible with FCP6.  Sometimes, these editors are called to work on a few historical projects that have been published in FCP6 and need this version to run now.

    Starting with OS X Lion, FCP6 would install not in Lion and thereafter.

    According research by Jeremy Johnston as noted on his blog, he discovered that Apple has inserted a file in the folder CoreServices in the Library folder of the system folder that causes versions the version Final Cut Pro X (and other older Apple programs in the same situation) do not settle.  He suggested changes to this file that would seek to prevent interfering with the installation of FCP6 in Lion, many users of final cut PRO 6 were successful in their efforts to install in Lion and work with it.

    Later in a discussion update on installing FCP6 in Mavericks, HawaiianHippie determined that the simplest way to perform the installation of FCP6 was simply copy this file and remove it from the system folder, install FCP6 and then restore the copied file:

    https://discussions.Apple.com/message/26309669#26309669

    I used this method with success to install FCS2 in Yosemite:

    [click on images to enlarge]

    However, in my attempts to install FCS2 in El Capitan, it fails in the last 5% to install the first DVD:

    First of all, I need advice on how to display an extremely large Setup log in this thread (on MacRumors, it is a method to insert a 'code' in a small box that can be the object of a scrollbar if necessary to read all along).  I am unable to find such a method to post here.

    Then once approved, I need help to determine which component is causing the installation to fail and perhaps this element can be omitted from the installation:

    If this element is not required, then maybe FCP6 can be installed successfully without it.  And if that omitted element is necessary, perhaps a manual method to install it can be determined by pacifists.

    It is my goal to help those who need to install and use FCP6 on their new Macs running El Capitan.

    Here is the post on MacRumors with pre-installed Setup log:

    http://forums.MacRumors.com/threads/i-need-help-with-an-installation-failure-to-interpret-and-troubleshoot-an-Installer-log.1954786/#post-22541389

Maybe you are looking for

  • 4th gen Apple TV WiFi Bridge.

    The 4th gen apple TV can be used as a wireless bridge? I have an Airport Express do this and he's sitting right next to my new Apple TV, just want to get rid of the Express if it is not necessary.

  • Installation SSD / old MacBook

    I have a 13-inch, aluminum, late 2008 MacBook, 2 Ghz Intel Core 2 Duo with 4 GB memory. I read that I could improve performance by installing an SSD in this regard. I cleaned up as I can without any result. It is currently running Yosemite 10.10.5 Is

  • LinkedIn badge on your signature

    How to add a badge of linkedin with a link to your email signature? LinkedIn while I managed to add the linkedin badge link, it does not work on mail signature?

  • Satellite L670D Simple Drive external HARD drive question

    OS Windows 7 Home. Preload by Toshiba. Have a Toshiba simpledrive 1 T. When plugged into the USB hardrive are rewritten with shortcuts. Hard drive in Explorer properties shows data from correct volume on the disk, but I don't have access to the drive

  • Where to find the Windows 7 language packs

    I am trying to add an additional language in my win 7. I know how to change, BUT I can not findWindows 7language packs on my windows... And its really annoying me as I much 'how to' red (this is why I know how to do yet) and they all say the same thi