Query to find the match on two areas where the third does not work...

Faced with this one...

Light of the example data
SECTION     GROUPID     SUBGROUPID     COMPONENT     PNUM     USERNAME
HVAC     AC     MOTOR          HOSE          111.1     BOB
HVAC     AC     MOTOR          HOSE          111.2     BOB
HVAC     AC     MOTOR          HOSE          111.3     JIM

HVAC     AC     MOTOR          BOLT          411     BOB
HVAC     AC     MOTOR          BOLT          411     BOB
HVAC     AC     MOTOR          BOLT          411     BOB
HVAC     AC     MOTOR          BOLT          (null)     (null)

HVAC     AC     MOTOR          CLAMP          211.1     BOB
HVAC     AC     MOTOR          CLAMP          211.2     JIM
HVAC     AC     MOTOR          CLAMP          211.3     BOB

HVAC     AC     MOTOR          STRAP          611.1     JIM

HVAC     AC     MOTOR          BELT          811.3     BOB
HVAC     AC     MOTOR          BELT          (null)     (null)

HVAC     AC     MOTOR          DISC          (null)     (null)
HVAC     AC     MOTOR          DISC          (null)     (null)
HVAC     AC     MOTOR          DISC          (null)     (null)
     
What I need is a list of records where the GroupID and component matching, and where they had a PNUM who were not all the same

So in this case I would like to only these returned, Section/SubgroupID/username are not required to match on anything whatsoever, but here to view the
additional data that may be there. Items that have PNUM which IS NULL should be ignored? Example would be the example above where the PNUM
for a record was 811,3 while one below is null, which should not return. Its considered to be 'ok' and does not need to be reported.

SECTION     GROUPID     SUBGROUPID     COMPONENT     PNUM     USERNAME
HVAC     AC     MOTOR          HOSE          111.1     BOB
HVAC     AC     MOTOR          HOSE          111.2     BOB
HVAC     AC     MOTOR          HOSE          111.3     JIM

HVAC     AC     MOTOR          CLAMP          211.1     BOB
HVAC     AC     MOTOR          CLAMP          211.2     JIM
HVAC     AC     MOTOR          CLAMP          211.3     BOB

Hello

To identify all incompatible groupid/component combinations:

SELECT       groupid, component
FROM       table_x
GROUP BY  groupid, component
HAVING       COUNT (DISTINCT pnum)     > 1
;

To view information on all lines with these groupid/component combinations, use the query above in an IN subquery:

SELECT  *
FROM     table_x
WHERE     (groupid, component)  IN
     (
          SELECT       groupid, component
          FROM       table_x
          GROUP BY  groupid, component
          HAVING       COUNT (DISTINCT pnum)     > 1
        )
;

I hope that answers your question.
If not, post a small example data (CREATE TABLE and only relevant columns, INSERT statements) and also publish outcomes from these data.
Explain, using specific examples, how you get these results from these data.
Always say what version of Oracle you are using (for example, 11.2.0.2.0).
See the FAQ forum {message identifier: = 9360002}

Tags: Database

Similar Questions

  • Find the theme does not work for priorities

    In the module list of the topic I want to find issues by priority, but it does not work. Here's what I do:

    1.      Ensure at least a topic has a priority of '1'.

    2.      Click the icon of the topic find and select the Advanced tab.

    3. enter a string in the file name field includes (e.g. reports) which returns a set of found topics that include the subject I put for priority "1". At this point, I can see in the topics it is really the priority "1" (see the first picture below).

    4.      Change the drop-down list priority "superior to" and leave the corresponding text set to '5'.

    The result is 'No found subjects' (see the second image below).

    I hope someone can point me in the right direction. I use RoboHelp 9.0.0.228.

    find-topic-a.pngfind-topic-b.png

    I did not have RH9, but what happens if you "lower"?

  • Find the keyword does not work properly in Bridge CS4

    Recently, I upgraded my Bridge CS3 to CS4 and I'm unable to do a find for the keywords now. All my photos that I had recorded with a keyword has prevented the key words of the CS3, but any time that do a find for some keyword, he says he found nothing. However, when I go to a certain picture bridge or highlight as the photo, and then select do a find for this photo by using the keyword I've been saving for this, he would acknowledge the keyword and find the photo then. I have hundreds of photos and I don't have the time to open every single folder and select each picture just so that bridge will recognize its key. Is there a way around this and if anyone else has had this problem?

    but any time do a find for some keyword.

    Try the search (Edition/search or cmd + F) menu. Choose your main folder that all your files are in Source. Criteria choose keyword and fill in one of the desired keywords.

    Be sure to have a check mark in fornt of the options "Include all subfolders" and "include Non-indexed files.

    Press search and let bridge, he is looking. This first time may take a little long but now bridge starts to index all the files. After that, you should be able to use the option to find keywords as usual.

  • How to reset the password for CC? -My former CC password does not work. I can't find that link 'forgot my password' My Adobe password does not work in CC

    How to reset the password for CC? -My former CC password does not work. I can't find that link 'forgot my password' My Adobe password does not work in CC

    Contact support Adobe by clicking here and, when available, click on "still need help," https://helpx.adobe.com/contact.html

  • CD drive does not open and the light does not work

    original title: single CD player problem

    The problem with my CD player seems to be unique I can't find an answer, or someone else with the same problem online.

    My computer is custom built, the CD player lasted me 1.5 years no problem, not until one day I realize, it does not open and the light does not work on it, I ordered a new drive and installed that one, still does not work. so, I replaced the SATA cable which connects to the motherboard, still does not.

    When I go to my computer the drive appears but when I right click > eject it says: "year error occurred while ejecting CD drive D".  It also appears in devices such as SCSI CdRom Device Manager but I am not sure if it's actually my CD player.

    I also tried troubleshooting http://support.microsoft.com/gp/cd_dvd_drive_problems and no solution.

    WTFFF ideas? I really hope that its not the motherboard

    There are two cables you need to connect to the drive, one for data and one for power.  You must connect both training at work.  If you only have the data cable is plugged and not cable power which would be a possible cause of the problem that you see.

    "Ryanb1290" wrote in the new message: * e-mail address is removed from the privacy... *

    Sorry, im just of knowledge about computer hardware.  you say that I should try a different agreement or another port to plug in?

    I tried to connect on a couple different SATA ports on the motherboard.

  • using firefox 24, yahoo toolbar disappears and the keyboard does not work on some websites

    We have installed firefox 24, yahoo toolbar sometimes disappears. On some web site when trying to enter a password, the keyboard does not work until you double click of the mouse on the registration form. This on two different systems of windows 7. Each thin seemed to work fine before the update prior to the installation of 24.

    Hello

    Try Firefox Safe mode to see if the problem goes away. Safe mode is a troubleshooting mode, which disables most of the modules.

    (If you use it, switch to the default theme).

    • Under Windows, you can open Firefox 4.0 + in Safe Mode holding the key SHIFT key when you open the desktop Firefox or shortcut in the start menu.
    • On Mac, you can open Firefox 4.0 + in Safe Mode holding the key option key when starting Firefox.
    • Under Linux, you can open Firefox 4.0 + with leaving Firefox then go to your Terminal and running Safe Mode: firefox-safe-mode (you may need to specify the installation path of Firefox for example/usr/lib/firefox)
    • Or open the Help menu and click on the restart with the disabled... modules menu item while Firefox is running.

    Once you get the pop-up, simply select "" boot mode safe. "

    If the issue is not present in Firefox Safe Mode, your problem is probably caused by an extension, and you need to understand that one. To do this, please follow article Troubleshooting extensions, themes and problems of hardware acceleration to resolve common Firefox problems .

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before you open Firefox for normal use again.

    When find you what is causing your problems, please let us know. It might help others who have the same problem.

    I hope this helps!

    Curtis

  • zynga took my moms account and changed password for facebook and e-mail, she followed the steps to change the password, but the link does not work

    I gave this e-mail address to answer to another email user but my password has been changed and nt theres initially asked

    zynga took my moms account and changed password for facebook and e-mail, she followed the steps to change the password but the link does not work as it changes the password of my account, she tried this link 3 times now is there anything else she can try.

    Hello

    ·        What operating system is installed on your computer?

    ·        What browser do you use to connect to the internet?

    ·        Which email service provider you are talking about?

    Because the problem is linked to facebook I suggest you to post your query on facebook forum for assistance:

    http://www.Facebook.com/help/community/

  • I can't select or copy text on Firefox for Android 26.0.1 (device: Samsung Galaxy Note 2) OS: Android 4.3. Long press on the text does not work. )

    Can't select or copy text on Firefox for Android 26.0.1.
    Device: Samsung Galaxy 2 Note.
    OS: Android 4.3.
    Long press on the text does not work.

    I would ask someone to check that...

    I'm glad to hear that your problem has been resolved by using the beta version.

    If you have not already the case, please mark this thread as solved by the solution of marking.

    This will help other users experience similar problems helps to find faster and more efficiently.

    I hope that you will continue using our products and we thank you for contacting the Mozilla Support.

  • Key on the keyboard does not work in firefox box when you type in the web site, but it works everywhere else?

    Key on the keyboard does not work in firefox box when you type in the web site, but it works everywhere else?

    Try Firefox SafeMode to see how it works there.

    A way of solving problems, which disables most of the modules.

    (If you use it, switch to the default theme).

    • You can open the mode without failure of Firefox 4.0 + by pressing the SHIFT key when you use the desktop Firefox or shortcut in the start menu.
    • Or use the Help menu option, click restart with the disabled... modules while Firefox is running.

    Do not choose anything at the moment, just use 'continue in safe mode.

    To exit safe mode of Firefox, simply close Firefox and wait a few seconds before using the shortcut of Firefox (without the Shift key) to open it again.

    If it's good in Firefox Safe mode, your problem is probably caused by an extension, and you need to understand that one.

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+themes

    Can be caused by an add-on to the AVG.

    When find you what is causing that, please let us know. It might help others who have this problem.

  • Satellite C660 - click of the mouse does not work

    Hello

    I bought this laptop 5 weeks ago and now have problems with the right, click on the mouse does not work. Left click sometimes opens to the left, click on functions and leaves me is impossible to close programs or closed, double clicking in the pavement or enter does not work also.

    I tried to do a system restore to the factory, but I can not click on the next to take me through the restoration and end up having to close it via the main power switch.

    Any ideas please?

    Hello

    You have the same problems with a mouse external or just the touchpad?

    If an external mouse works correctly, you can use it to do a recovery install. This can help you to solve the problem, if this just s software.

    Not least have last but you tried to update the driver for the touchpad? You can find it on the official website of Toshiba:
    http://EU.computers.Toshiba-Europe.com > support & downloads > download drivers

    Check this box!

  • Satellite Pro 4200 overheating because the fan does not work

    I have a satellite Pro 4200 and it keeps overheating because the fan does not work I went in and everything seems ok but then I power it upward but the fan does not work someone can help? all cables are connected the fan run at all.

    Hello

    And how to help her in this situation? If you are sure that it cooling fan doesn t work 100% needs to be replaced.
    By the way: did you clean the unit and remove the dust?

  • Re: Satellite A350 - the lightkeys does not work

    Hello world

    I have a Toshiba Satellite A350, but recently, the lightkeys does not work.
    Can you help me pls?

    What do you mean exactly? Are that they OFF and you can not activated or you cannot use them with player for playback, pause and other functions?

    Have you tried to reinstall Toshiba Value added Package?
    If this isn't the case, please do. Remove the preinstalled version and after mobile download page restart install the most recent version of Toshiba.

  • Satellite P850-30W - the fan does not work after returning from the mode "Eve"

    I have a Toshiba Satellite P850 30W with bios 1.90.

    Sometimes the fan does not work at all after back mode standby on windows 7.
    What happened twice (perhaps several times without knowing me), and Ive had the computers for a month.

    Normally the fan starts to run when the CPU gets more than 50 degrees celsius and stops less than 50 celisus...

    I tried running Prime95 when this fan-this occurs and the time of the computer got dangerously high (near 100 degrees)! the fan did not start at all
    .. .This error could damage the laptop potentinally...
    to get the fan turns once again I have to restart windows

    anyone experienced this?
    I guess that the fix would be to never use standby... or toshiba needs to fix it with an update of the bios.

    > Sometimes the fan does not work at all after back mode standby on windows 7.
    > What has happened twice (perhaps several times without knowing me), and Ive had the computers for a month.

    You said it's happened twice and only sometimes done this means that above all the fans are working well?
    In this case, this would mean that it of difficult to reproduce this problem, but you might be right: maybe a BIOS update would help solve this problem permanently

    I found some discussions on the stand-by mode and fan activity and in most cases, the update of the BIOS was the key.

  • My labtop sound works, but when connect the headphones does not work

    My labtop sound works, but when connect the headphones does not work. Note that the headset before 1 HR was working.

    Hello

    ·         Are these USB headset or headphone jack analog standard?

    ·         What version of the operating system is installed on the system?

    If you continue Windows 7 or Windows Vista refer to the procedure in method provided below and check if they help to resolve the issue.

    Method 1:

    Step 1:

    You can check if the headphones are activated as a playback device. To do this, see the following steps:

    (a) the Pearl-click Start and type Sound in the start search box.

    (b) in the Start Menu Options, select change adapter settings .

    (c) then, on the Read tab, right-click and select Show hidden devices and Show disconnected devices if they are available.

    (d) select headphones and select

    Step 2:

    Also try to put headphones of default device and check, follow the steps below.

    (a) go to Start and click on Panel.

    (b) click Sound, and then a new window will open.

    (c) in the new window click on the "Playback" tab and right-click in the window and click on Show disabled devices.

    (d) now check if headphone is listed there and right-click on it and choose activate.

    (e) highlight this helmet and click on "as default'.»»

  • I have laptop (hp probook 4520 s), the touchpad does not work. How can I turn it back on it?

    I have laptop (hp probook 4520 s), the touchpad does not work. How can I turn it back on it?

    This is a question which would probably respond by HP support, because it isn't really a Windows problem.

    Are you sure that the touchpad is not just turned off? Many laptops have switches, power switch, so you can rest your palm while typing one is not worry by pressing the key.

    Sometimes, there is a button above the key, a key on the Ko, or some have a stain on the pavement you waiting/tap/double tap/etc. to toggle the pad.

    If not, you could try to go on the site of HP and DOWNLOAD/reinstall assistance the SW for the touch pad.

Maybe you are looking for