Another group by having problem I think ...

I have a table defined like so ...
create table mytable (
subcode number,
name varchar2(10)
I suspect that I have records in this table that look like so ...
SUBCODE NAME
123 Jim
123 Mary
... this is bad.
I ran a query like this ...
select subcode, name, count(subcode) from mytable group by subcode, name having count(subcode) > 1
... and got back zero results.
Does this mean I DO NOT have duplicates?
Thanks

You do have duplicates but your statement doesn't show that since you are grouping by SUBCODE and NAME. Since your have the same SUBCODE but a different NAME for the duplicate SUBCODE you get only 1 result with your group by statement. Here are two examples:
select subcode, name, count(subcode)
from mytable
group by subcode, name
   SUBCODE COUNT(SUBCODE)
       123              2
select subcode, name, count(subcode)
from mytable
group by subcode, name
   SUBCODE NAME       COUNT(SUBCODE)
       123 JIM                     1
       123 MARY                    1This statement will give you what you are looking for:
select subcode, name
from mytable
where subcode = (select subcode
                    from mytable
                    group by subcode
                    having count(subcode) > 1);

Similar Messages

  • I have 3 computers. i want to get files from one to another. it doesn't work, i think it is a problem with the apple id?

    i have 3 computers. i want to get files from one to another. it doesn't work, i think it is a problem with the apple id?

    Roger:
    Zugriffsrecht means Access Right according to the translators.
    martinamm:
    You can't do what you want with iCloud.  You will need to setup remote access to your main computer with VPS or some similar remote access application.   With VPS you have an application running on your main computer turning it into a server and an client app on your laptop so you can access it remotely.  There are many such apps out there, some probably more feature filled than VPS.  You might post in the system forum that you're running and ask there.
    OT

  • I am having problems copying and pasting clips from one project timeline to another. When I do this they often alter in length. Sometimes by two frames. Other times they lose a chunk off the end of the last clip in the sequence. Has anyone else found

    I am having problems copying and pasting clips from one project timeline to another. When I do this they often alter in length. Sometimes by two frames. Other times they lose a chunk off the end of the last clip in the sequence. Has anyone else found this?

    You need to give a lot more information about the media specifications and the project properties you're using in the different projects.

  • I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    I just paid for Adobe PDF pack and I think I am having problems installing. When I select to print from word, PDF is not an option. Help!

    Hi voltric2014,
    If you are on Windows, you can download and install the CreatePDF Desktop Printer, which would allow you to "print" to PDF from Word. You'll find a link to the installer on the CreatePDF page at https://cloud.acrobat.com. Here are the instructions for installing it: Using Adobe PDF Pack
    Please let us know if you have additional questions.
    Best,
    Sara

  • I am having problems to run an app, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me?

    I am having problems to run an app, there is an error display that says I need to set  bonjour services

    Logic is the APPlication (program, app) that you are having the problem with.
    Logic Pro can take advantage of other computers on your local (home or work) network to help it do "heavy lifting" data chores by using Bonjour and a feature called Nodes.   It seems that Logic is attempting to find and connect to another machine on your network.
    Do you have Logic installed on another computer there?  That may be the source of the confilict.
    You might want to post this question in the Logic Pro Community.
    Be sure to indicate the version of Logic Pro that you are using.  I'm sure the folks there can help you out.

  • Problem with GROUP BY/HAVING in Sybase -- Oracle Migration

    Having problem converting SQL from Sybase to Oracle. The SQL statement in Sybase does
    not work in Oracle (ORA-979). When make changes the Oracle result is incorrect. Oracle Version
    is 8.1.6.3.
    #1 Sybase
    SELECT
    BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
    RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
    FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
    WHERE (t.newssn = ans.SSN)
    GROUP BY
    SSN
    HAVING obs_date = MAX(obs_date);
    Result = 19,567 (Correct)
    #2 Oracle (8.1.6.3)
    SELECT
    BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
    RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
    FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
    WHERE (t.newssn = ans.SSN)
    GROUP BY
    SSN
    HAVING obs_date = MAX(obs_date);
    Result = ORA-00979 not a Group By expression
    #3 Oracle
    SELECT
    BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
    RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, MAX(OBS_DATE)
    FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
    WHERE (t.newssn = ans.SSN)
    GROUP BY
    OBS_DATE, BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
    RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND
    HAVING obs_date = MAX(obs_date);
    Result = 19,598 (incorrect count)
    Possible suggestions?

    SELECT
    BIRTHDTE, FSCDTE, MINCDE, RETDISDTE, RETOPTDTE, RETPLAN,
    RMPAYSTAT, RSCDTE, SEX, SSN, VETPREF, VIETVETIND, OBS_DATE
    FROM wims3.adm_new_stscrnt ans, wims3.tt_t_ssn2 t
    WHERE (t.newssn = ans.SSN)
    AND obs_date = (select MAX(obs_date) from wims3.adm_new_stscrnt ans2, wims3.tt_t_ssn2 t2 where ...)
    ... should be the primary key-where

  • I am having the same problem I think.  With mobileme you simply copy documents to the idisk folder and then synch.  I cannot seem to sink that folder anymore.  Any idea as to how I can simply copy folders to icloud and then access the MS Word and PDF file

    I am having the same problem I think.  With mobileme you simply copy documents to the idisk folder and then synch.  I cannot seem to sink that folder anymore.  Any idea as to how I can simply copy folders to icloud and then access the MS Word and PDF files on my iphone?

    Apple never bopthered to explain that this would happen
    Your iDisk is still accessible after moving to iCloud in exactly the same way as before. Nothing is deleted until June 30th 2012.
    , so I could easily have lost ALL of the files I kept on iDisk.
    No, you couldn't. Firstly, nothing was deleted from your iDisk. Secondly, any files stored on your iDisk should never be your only copy. Even if your iDisk spontaneously combusted, you should keep local backups elsewhere.
    Does Apple WANT people to move their storage elsewhere and stop paying Apple for it?
    Yes. Apple doesn't provide such a service anymore, nor are you paying them for it.
    Apple has made no effort to suggest remedies for the problem it has given iDisk users
    They've provided instructions on how to download your files from your iDisk. What you do with them after that is your choice.

  • Version 8.0 self installed the other day. My computer immediately began having problems. I uninstalled 8.0 TODAY and it just reinstalled itself. I NEVER use any software version that ends with .0 - please fix this problem or I'll switch to another browser

    Version 8.0 self installed the other day. My computer immediately began having problems. I uninstalled 8.0 TODAY and it just reinstalled itself. I NEVER use any software version that ends with .0 - please fix this problem or I'll switch to another browser

    '''I fixed mine by removing the Ask.com extension.'''
    Tools
    Add-ons
    Settings icon
    View Recent Updates
    Ask.com '''DISABLE'''
    Running FF 8.0 on Windows 7 (64-bit)

  • I am having problems playing a cd I burned on my Mac on another player.

    I am having problems playing a cd I burned in my Mac on another player. 

    I am having problems playing a cd I burned in my Mac on another player. 

  • Skype 6.11- I was thinking of downloading Maverick, but I am seeing that Skype is having problems with it. Is this still true. I am on snow leopard 10.6.8 now

    I was thinking of downloading Maverick, but I am seeing that Skype is having problems with it. Is this still true. I am on snow leopard 10.6.8 now

    Hi,
    I'm using Mavericks and there are no issues with SKYPE.
    I using SKYPE 6.9 and this version is working well without issue.
    For some reason I didn't downloaded SKYPE 6.11 I don't know why anymore ... but I'm sure I hat my reasons not to do so.
    Dimaxum

  • I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me?

    I am having problems to run logic pro 9, there is an error display that says I need to set bonjour and that this app serial number has been used by another red user,  could anybody guide me? actually, my computer can't start  since three days ago, could it be the same problem?

    Logic is the APPlication (program, app) that you are having the problem with.
    Logic Pro can take advantage of other computers on your local (home or work) network to help it do "heavy lifting" data chores by using Bonjour and a feature called Nodes.   It seems that Logic is attempting to find and connect to another machine on your network.
    Do you have Logic installed on another computer there?  That may be the source of the confilict.
    You might want to post this question in the Logic Pro Community.
    Be sure to indicate the version of Logic Pro that you are using.  I'm sure the folks there can help you out.

  • My ipod jumps from one screen / app to another on it's own. Sometimes I can't unlock or even shut off. I've tried the reset, I've tried back up, even tried restoring to factory settings and is still having problem. Any ideas of what I can do.

    My ipod jumps from one screen / app to another on it's own. Sometimes I can't unlock or even shut off. I've tried the reset, I've tried back up, even tried restoring to factory settings and is still having problem. Any ideas of what I can do.

    When you still have the problem after restoring to factory defaults/new iPod then you very likely have a hardware problem and an appointment a th Genius Bar of an Apple store is in order.

  • Adding another Airport Extreme – I'm having problems-

    …please help.
    I am a total novice when it comes to networking so please explain clearly. I had one AE connected to some speakers in the kitchen so I could stream music there. I got another AE today to connect to my router to hopefully provide a quicker and more reliable wireless connection.
    I'm having problems adding the 2 AE to the same network. Tried lots of different ways but nothings worked. I can't my mac to find them both at the same time? When I try to add the other one it asks me to switch networks. When I switch networks i can't see the previous one so I can't add it.
    is there any step by step guide to getting 2 AE up and running i.e. adding another AE to an existing network?
    Cheers in advance.

    kroc_kroc, Welcome to the discussion area!
    Even though the title of your thread says "Extreme" I thing you really mean "Express".
    If you are trying to connect the 2nd AirPort Express (AX) wirelessly...
    (1) Make sure that the 2nd AX is in an area with a good wireless signal from your current wireless network.
    (2) Configure the 2nd AX to join a wireless network and select your current wireless network.

  • I was having problems with my iPhone 5s. Was able to get another 5s. In the process of setting it up, but it is taking forever ... and it seems to be frozen at one particular place.

    I was having problems with my iPhone 5s (couldn't receive iMessages or emails). Cell company tried "fixing it" but to no avail. They ordered me a repacement 5s. Trying to set up, but it is taking forever. Seems to be stuck in one particular spot. It's at the stage with a black screen, white apple icon and a bar underneath. The bar is is just a fraction complete, and it has been stuck in this spot for almost an hour. Tried to restart it but it went to the same spot and froze again.

    BOB we need you urgently
    Perhaps Bob will see this thread, he is the professor in these cases.
    You do not use a WEP password but wpa/wpa2 on router and equipment.
    All equipment connects to WiFi, but for your iPad.
    Even with all other equipment WiFi off, you cannot connect your iPad.
    Your iPad connects to other WiFi nets correctly.
    All resets etc done on iPad and Router.
    Still I am not sure it is your router for sure, frustrating...
    I want to test 2 other things:
    1. in your iPad, set everything OFF in Settings/Cellular, turn off/then/on your WiFi, and see whether it will still not connect...
    2. If that does not do it: disconnect the router as well as the modem from the power, for 15 seconds, then reconnect the modem, let it fully start, then reconnect the routet let it fully start, turn of your WiFi in iPad, then on, and see whether it will connect.

  • I have an iphone 4.  Recently I cannot receive pictures or receive normal texts. All my texts come in as ichat messages.  Even if it's from another iphone.  I've reset and followed the support page instructions... still having problems. Thanks!

    I have an iphone 4.  Recently I have been unable to receive pictures or normal texts.  All texts come in as ichat messages.  The phone is slow and it takes a while to get the messages.  I've reset the phone and followed the steps on the support page.  Still having problems!  Any suggestions??
    Thanks!

    Hi,
    I also have a similar issue since upgrading from the 4s to the 5s.
    The issue I have is, issue number 2:" If I do receive a text message/iMessage notification, it disappears within 5-10 minutes before I can even check (no other notifications disappear)"
    Which also consists of the same events in the last message from monicash "So for example, if i get a text while sleeping... i wake up in the morning to check my notifications and there is nothing there because it disappeared (even though there should be a notification there with my current settings that are ON)."

Maybe you are looking for

  • How to map Product Group for the Materials in BW.

    Hi All, We have an requirement for one of the report called as Progress validation Report. We have to craete thsi repotr which would pulll out Inventory value, Production Plan value, Total Lates, Current week deliveries and WIP for a quarter. Cube wh

  • BEA Liquid Thinker Site not working for me

    Hi, I am using Firefox 2.0. on Linux and with Flash Player 9 installed but the Liquid Thinker site still doesn't let me in. What can I do? Many thanks EE

  • Closing a QT7 window requires multiple clicks, help!!

    When I simply want to close a QT video window by clicking on the "X", it is unresponsive. Then I click it again and a small window appears, says, "Do you want to save changes made in the document? Your changes will be lost if you do not change them".

  • What is the best way to migrate oracle 7.1 to oracle 10g with minimal time

    Hi We are going to migrate data from oracle 7.1 to oracle 10g , in 10g we have already planned partition table strategy and we want to add 2 fields in each and every table . Which is the best mechanism to take data from 7.1 add 2 fields , may re-arra

  • How to backup filters in Essbase 11.1.2.1

    Hi, I can not find the correct way to backup (and copy to production) the Essbase filters. The documentation says that filters are still stored in the Essbase.sec file, but copying over the Essbase.sec does not copy over the filters. Any ideas how to