How to show the correct address

Hello

I have this query.

Select distinct JHS, org.name, adr.address_id, adr.line_1_address, adr.address_type, adr.line_1_address, adr.postal_area

Of

-Doctors allow transmissions

(select c.customer_id, c.customer_sub_type, c.name, c.first_name, c.onekey_id, c.country_code, c.onekey_status, c.status, af.to_customer_id, afex.primary_mailing_flag

client c inner join person p on c.customer_id = p.customer_id

affiliation to join internal af on af.from_customer_id = c.customer_id

afex inner join afex.affiliation_id on affiliation_extra = af.affiliation_id

where p.no_mail_flag = '0' and p.privacy_law_status = '0' and c.status = 'ACTV' and c.onekey_status = '3' and c.country_code ("SE", "DK", "NO","FI")

and 'c.customer_type =' CLOSE and afex.primary_mailing_flag = - 1 and afex.no_mail_flag = 0 and afex.privacy_law_status = 0

and c.onekey_id in ('WSEM00014119', 'WSEM00012829', 'WFIM00032396')) ind

inner join

-Organizations allow mailings

(select c.customer_id, c.customer_type, c.name, c.first_name, c.onekey_id, c.country_code, c.onekey_status, c.status, af.address_id

of the affiliation of inner join customer c af on c.customer_id = af.from_customer_id

on .customer_id = af.from_customer_id inner join legal_entity

where the .no_mail_flag = 0 and the .privacy_law_status = 0 and c.customer_type <>'CLOSE '.

and c.country_code ("SE", "DK", "NO","FI") and c.status ='ACTV 'and c.onekey_status ='3 ') org on ind.to_customer_id = org.customer_id

inner join

-mailing address

(select addr.address_id, addr.address_type, addr.postal_area, addr.line_1_address, afad.from_customer_id

Affiliate afad inner join address addr on afad.address_id = addr.address_id

where addr.status = 'ACTV' and afad.status = 'ACTV' and afad.onekey_status = '3'

1.2 desc order) adr on adr.address_id = org.address_id and adr.from_customer_id = org.customer_id


I am trying to extract doctors with the exact mailing address, my problem is that when I test this query with these 3 doctors I had 4 ranks as one of the doctors has 2 address, one with the type of MAIL and the other with the type of PHYSICAL education.


My rule is to verify if these doctors do not have the E-MAIL address type to show the type of PHYSICAL education, but if these doctors have MAIL and PHYS type address just to show the type of MAIL.


I used the function Exists and Not exists, but it does not work in cases when a there are two types of addresses.

I can not create views, tables, for a report.


Could you help me?


Thanks in advance.

BR

Raúl

Similar thread

Restriction of column based on the join condition

Hope this will help.

Tags: Database

Similar Questions

  • How to show the email address complete in the message and other areas

    How to view the email address complete address in To, Cc and other fields?  When I type a name that the name does not appear the part @xxxx.com address.

    Hello there jimhaynes,

    Looks like you see the names of people you're emailing, instead you send your e-mail to the e-mail address. You should be able to change that behavior by disabling the option called "Smart addresses using" located in Mail > Preferences > look a.

    If it is already disabled, it switches on, then back to refresh the setting. Once you have done this, you should see the name of the person next to their email when you type one in. It should look like this example: "Kelly Westover [email protected]>.

    If you want to continue to use smart addresses, you can click on the name to reveal more information about the contact by the following article:

    Address postal (El Capitan): use smart addresses

    https://support.Apple.com/kb/PH22294?locale=en_US&viewlocale=en_US

    Thank you for using communities of Apple Support.

  • Some how my address book is only showing the personal address list and not list collected and the list of groups. How can I restore these

    I don't know what happened, but the display of my address book has changed for visible group names and also a visible tab to show the collected addresses. I see now are the personal address list

    Open the address book
    In the Menu bar select view-page-directory pane

    No menu bar? Press the ALT key.

  • How to change the ip address of the printer

    How can I change the ip address that windows searches for what concerns my printer wireless?

    My printer continues to change its ip address that is to say yesterday that the address is 192.168.0.2 and now it's 102.168.0.5, and whenever he does, windows does not include only and that he keeps trying to print address ip to wring the origin install me the printer as a new one from the new ip address give me two of the same printers when I watch devices and printers.
    I would like to know just how to change the ip address that is referenced to the printer rather than install them separately as a new printer.
    Any ideas would be appreciated.

    I always prefer to set a static IP address for the network printers to avoid this kind of problem.   Depending on the brand of printer, this can be done by using the printers Panel (see networking options in the menus), or there may be a web interface, you can open in a browser.  Assigned address must be in the correct subnet but outside the DHCP in your router address.  Once assigned, specify this address in the settings of the printer on each workstation.
    You have not given any information re. the printer or your network and router model, so I can't be more specific than that, but it's the best general solution of this question.

  • How to find the Mac address of a Blackberry Curve 8130 BlackBerry Smartphones

    I have a wireless router in my house that has a MAC filter enabled. I do not have permission to change this setting on the router. I need to find the Mac address of the Blackberry 8130 device to be added to the routers MAC filter allow list only.

    Can someone help me with the knowledge on how to find the MAC address of a Blackberry 8130 Curve?.

    Thanks for the help in advance.

    Concerning

    VK

    I forgot to mention: new to Blackberry Curve 8130 (previous was the old black version with the wheel) and the network is T-Mobile with SIM card (not CDMA).

    Does show under Options | Status as the WLAN Mac address?

  • How to get the IP address of the calling client to the web service built in Jdeveloper 11.1.1.7 application?

    I built an application of web service in Jdeveloper 11.1.1.7 to be used by other clients. Just the General steps as follows (Server web service Application is generated--> deployed on the server-> used by clients with the location of the WSDL file).

    Now, I met a requirement where I need to get the port number and IP address for the client.

    Questions :

    How to get the IP address of the calling client to the web service application generated in Jdeveloper?

    Commune technologies used to build web service applications is AXIS or CXF. What Jdeveloper technology use to built web service application?

    The common technologies used to build web service applications is AXIS or CXF. What Jdeveloper technology allows built web service application?

    It depends on the option selected during the creation of web services (if I remember correctly, there are several options, style J2EE 1.4 RPC style JavaEE JAX - WS 1.5,...)

    For example, to get the ip address of the compatible with jax - ws web service, you need to inject the context in your service class with:

    @Resource
    WebServiceContext wsContext;
    

    and then inside your method:

    MessageContext mc = wsContext.getMessageContext();
    HttpServletRequest req = (HttpServletRequest)mc.get(MessageContext.SERVLET_REQUEST);
    String ip = req.getRemoteAddr();
    

    Dario

  • After deployment got "404 Not Found".  How to find the correct URL?

    For the experienced:

    Preparing to deploy my application, I use JDeveloper 10.1.3.4 to deploy the application on the server standalone oc4j included in JDeveloper. After deployment, I get the error "404 Not Found" when trying to invoke the application in a browser. The deployment seems OK, because the log in JDeveloper window showed no error executing deployment from inside JDeveloper. So I guess the question is how to find the correct URL to invoke the application. Here are the steps I took to make the deployment.

    First, I installed the standalone oc4j by running the .bat < jdev_home > \jdev\bin\start_oc4j file. Installation is OK because I have deployed the application SRTutorial and invoked successfully in a browser.

    The WAR file has been created by right-clicking on the ViewController project and select this option to create a WAR file. At the root of the application its own name, I typed "ZB" in the area of the root of context.

    Then in ViewController-> resources, right_click the deployment file (ZBOV.deploy) and chose ' deploy to "the local_standalone_oc4j. Messages in the Journal of JDeveloper window for deployment are all nice and clean without errors.

    I then used this url to invoke the application deployed in a browser:

    http://localhost:8888/ZB/faces/staff/login.JSPX

    But I got an error "404 Not Found". Immediately, I tried citing the application of SRTutorial, and it works fine.

    Login.JSPX is one of the pages of the application. In the browser of the application, it is with other files in the content of ViewController/Web/personal folder, so I used /staff/login.jspx after ZB/faces.

    What could be wrong? If the deployment is really successful, how to find the correct url to invoke the application?

    Thanks a lot for your help!


    Newman

    Hello

    According to me, there are 2 possibilities (could be more that I'm not aware of if :)).

    1. your deployment profile has been changed to use a different context root.
    2. your request has not been installed correctly.

    To 1, try to create a new deployment profile and leave the values by default as it is the case, run the jspx page, get the root context, deploy the application to a different OC4J instance (using the new deployment profile), and then run the application with the context root, that you received from the embedded OC4J.

    For 2, check the log file and see if you had any error / exception.

    HTH.

    Arun-

  • How to show the photo album in Apple Tv screensaver.

    How to show the photo album in Apple Tv screensaver. ?

    You can use your photo stream or albums shared for the screen saver, the iCloud photo library can be viewed only manually.

  • How to get the IP address of the client when TCP connect on the server

    How to get the IP address of the client when TCP connect on the server.

    The only parameter obtained the login is the login ID.

    I assume you are using "Wait of TCP on the listening port" on the server. This returns the remote address and port (like out in option).

  • Does anyone know how to find the ip address of someone who is to be a nuiscance?

    Does anyone know how to find the ip address of a person who uses different names to communicate with you. A member of the family has problems with someone who does this.  Thank you in advance, I know one of the guys will help me.

    Hi, Ros,

    Use the e-mail headers

    http://www.johnru.com/Active-WHOIS/trace-email.html

  • How to show the ink levels on the computer for Officejet 6600

    How to show the ink levels on the computer for Officejet 6600

    What is the full product name or product number?

    is your printer?

    This is the Manual of your printer the following image was derived.

    You can use the printer's built-in web server to get the status of the printer information from a browser.

  • How to show the multiple declaration for an application

    How to show the multiple declaration for an application

    Thanks for your suggestions...

    Looking at the javadocs you can only save an indicator by application. You will need to do three separate applications and package them as an If you want three different indicators to be visible at a time. Or change the flag that (or which group) of the indicators you want to display.

  • How to show the main screen (home screen of blackberry)

    Hi guys,.

    I need to know how to show the main screen (home screen of the blackberry), even if it's in any screen (like saying "Calculator" etc)...

    This must be done by programming... is there a solution for this?

    Thanks in advance,

    I also had. This is to disconnect incoming call and display the main screen (home screen of the blackberry).

    EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_DOWN, (char) Keypad.KEY_END, 0, 100));
    EventInjector.invokeEvent (new EventInjector.KeyCodeEvent (EventInjector.KeyCodeEvent.KEY_UP, (char) Keypad.KEY_END, 0, 100));

  • How to get the MAC address of the additional 10G NIC with command-line ILO

    How to get the MAC address of the additional 10G NIC with ILO command line?

    Thank you.

    Hi Bruce,.

    Out of what I can find on this network card is not available for the Mac without an operating system. I recommend get/burning a live CD/DVD of Ubuntu/Linux and run an Ifconfig in there.

    Hope this helps you.

  • How to avoid the color address IOS in email HTML Template?

    Hello

    How to avoid the color address IOS in email HTML Template?

    Thank you

    Rahul Bhambri

    Hello Rahul,

    Please use css in your style sheet

    a {[x-Apple - detectors of data]

    color: inherit! important;

    text-decoration: none! important;

    font size: inherit! important;

    Police-family: inherit! important;

    Police-weight: inherit! important;

    line-height: inherit! important;

    }

    Thank you

    edynamic expert Eloqua

Maybe you are looking for