Count problem...'IN' and 'NOT IN' problem?

I'm not sure what I missed here. Can anyone help?
I have an address_main table, and a case_main table. Case_main attach case to address by using address_id, which is a unique number.
SQL> select count(address_id) from address_main;
COUNT(*)
39576
SQL> select count(address_id) from address_main
where ADDRESS_ID in (select address_id from case_main);
COUNT(ADDRESS_ID)
39080
I'm expecting the next statement come back a count result at 456 (39576-39080), but it returns '0'.
SQL> select count(address_id) from address_main
where ADDRESS_ID NOT IN(select address_id from case_main);
COUNT(ADDRESS_ID)
0
So 'IN' and 'NOT IN' can not cover all the posibility?

Check for NULL values, they often affect results just the way you describe.
Consider:
SQL> create table address_main(x) as
  2  select rownum
  3    from dual
  4  connect by level <= 5;
Table created.
SQL> create table case_main(x) as
  2  select rownum
  3    from dual
  4  connect by level <= 5;
Table created.
SQL> -- We'll update just one row in CASE_MAIN with NULL value
SQL> update case_main set x = NULL where x = 5;
1 row updated.
SQL> select * from address_main;
         X
         1
         2
         3
         4
         5
SQL> select * from case_main;
         X
         1
         2
         3
         4
SQL> select count(x) from address_main;
  COUNT(X)
         5
SQL> select count(x) from address_main
  2   where x in (select x from case_main);
  COUNT(X)
         4
SQL> -- But ...
SQL> select count(x) from address_main
  2   where x not in (select x from case_main);
  COUNT(X)
         0

Similar Messages

  • Apple's stance on ML problems - Reminders and Notes.

    Hello, all.
    I must confess I am puzzled with Apple's attitude towards its customer base and how neglectful it has become as a company.
    I just recently upgraded to Mountain Lion for the sole reason I wished to use Reminders and Notes. These are applications I use for BUSINESS and I use them every single day to manage my professional life.
    After I upgraded to Mountain Lion I was shocked to learn that Reminders and Notes can only by synchronized via iCloud. Notes was synchronized via cable through iTunes before. Why change it ? And why offer Reminders with a single sync option ? Many users are in the same situation I am in. As a healthcare provider I am required by law to ensure all my data is maintained private and confidential. Why would Apple choose to offer only one single sync option ?
    I have been strugling for the last two weeks trying to find a way to address Apple's design flaw (perhaps not a flaw but an intentional design decision). I can't seem to find a way to sycn these two apps without the use of iCloud and can't also find third party applications that would be good replacements for them.
    Aside from switching to a Windows-based phone (and perhaps even to a Windows-based computing platform) I don't know what to do. It has finally sunked in the idea I have heard before from so many long-time Mac users like me. Growth would prove challenging to Apple and perhaps condemn the company to becoming more like other mediocre companies that produce mediocre products. Apple no longer listens to customers like me who have been loyal customers for 30 or so years.
    I can't believe that with all the complaints out there Apple chooses to remain silent and do nothing to address the issue. This is indeed very sad. It is sad to see a company who made such great products in the past begin to decline.
    To those who have any knowledge of it, please I need help.
    IS THERE ANYWAY TO FIX THIS MESS ?
    IS THERE ANYWAY TO SYNC REMINDERS AND NOTES BETWEEN THE MAC AND IPHONE (IPAD) WITHOUT THE USE OF ICLOUD ?
    Thank you in advance for any help.

    Linc Davis wrote:
    I think most users including those who don't face the legal requirements that I do will agree that offering more than one choice to sync data would have been the right thing to do.
    Yes, I agree with that. And you do have more than one choice to sync data: (1) iCloud, and (2) OS X Server. That's not counting third-party options.
    This is not true. OS X Server is not a choice. The average user shouldn't be expected to pay for the client version of OS X and then pay again for the server version only to make two applications sync when they should do so right out of the box. The payment isn't the worst part. The labor involved in implementing OS X Server is the most difficult part. To expect the average user to use OS X Server as an option to sync Reminders and Notes is nothing short of absurd.
    It's not clear what you mean. Notes didn't exist before ML. It's an entirely new application. So is Reminders.
    This is not true. Notes existed before as part of the Mail application. I used it under Lion and was able to synchornize it via cable with iTunes. Mountain Lion removed Notes from Mail (a good choice in my opinion) and made it an independent application. However, it also removed the ability to sync it via cable.
    My intention was to search for help and perhaps input from others who have experienced the same issues. I don't have an agenda and don't wish to criticize Apple for any retaliatory reason. I am truly disappointed that a company this large would have made such an amateurish mistake and shared my perspective hoping it may help others and spark some changes. I have had other problems with Apple in the recent past when it failed to stand behind its products and the customer service I received from the company was the opposite of what I would have received 15 years ago.
    I have also contacted the company and provided feedback. The company has yet to respond and I don't think it will, which is quite sad.
    In regards to HIPPA I have already done my research and have it covered as long as Apple allows me to manage my data in the way that best fits my work requirements instead of trying to push a single solution because it wants to promote its iCloud service.

  • Problem with iTunes and not transferring media.

    This is differnt since the media it won't transfer has already been on the iPod once before. My iTunes won't tranfer some of my songs (that it did before) and some of my TV shows (that it did before as well) for some reaon or another. I have them set for autosync, no manual transfer, they are the latest episodes of the show, they are checked, and I have tried syncing it about eight times using different methods to get it to sync up. The songs a like every other song and not a problem with them.
    Any ideas?

    Everything corrected.

  • Wifi erratic on 4S after upgrading and not working even after resetting to factory setting. Why should apple isolate itself from their own product problems  Matter of shame when they are not ready to communicate with the customer means they are dead.

    11:22 (7 minutes ago)
    to AppleSupport
    Dear Sir/Madam Since  the wifi is not coming ON how can I open this diagnostic on the iphone  4S am using and having problem with wifi behaving in erratic manner. 
    Am  a professional engineer for projects and am 68 yrs old. At one time was  looking after a production line manufacturing I C's in semiconductors  manufacturing company of the US.
    Have four apple products, one hp laptop and one DELL professional computer at home is used by only two members me and my wife.
    Wife  prefers working on ipad2 or ipad mini while traveling and has iphone 4.  Am using iphone4S with laptop and Dell computer, No apple product is  more than two years old.
    Am having the problem in using wifi on the 4S after it  was upgraded to the latest ios as per the recommendation by your  software of my iphone 4S 
    The wifi card hangs up at  it's own will and even a visit to your authorized service center in  Delhi has not able to help me although they have reverted the ios back  to the
    one supplied with the set. Am a user and not a computer expert but it looks like the wifi card is  not able to some times take the load while working which could indicate  the wifi card is getting heated up.   
    My daughter  who is Masters in 3D Animation is an ardent fan of apple products  working at present in Canada was also gifted by me a 4S about 4 months  back. My daughter-in-law is using iphone4 and an ipad for her professional  works along with a Dell PC in the US. While my son is a fan of samsung  products and does not like an apple product. 
    So in a family we have 7 apple products except MAC laptop/PC. 
    But the fact is, this problem with 4S has  really shaken me up and now it seems your products are deteriorating in  quality while demanding the best pricing structures. 
    Since  this is purely the device and the software of apple problem you may  please replace this set with new one as neither have any time to push  you/ request you after your service centre
    in Delhi told me yesterday this cannot be repaired.   
    The  serial No of my set is DN*****TC0 and was bought from an authorized  dealer and so were the other products from the same dealer in Delhi.  This set is still in showroom condition and
    was never used without a protective cover. 
    Thanks 
    Ashok Dhingra
    D E E Hons B E Tech MBA
    Vasant Kunj Delhi
    <Personal Information Edited by Host>

    11:22 (7 minutes ago)
    to AppleSupport
    Dear Sir/Madam Since  the wifi is not coming ON how can I open this diagnostic on the iphone  4S am using and having problem with wifi behaving in erratic manner. 
    Am  a professional engineer for projects and am 68 yrs old. At one time was  looking after a production line manufacturing I C's in semiconductors  manufacturing company of the US.
    Have four apple products, one hp laptop and one DELL professional computer at home is used by only two members me and my wife.
    Wife  prefers working on ipad2 or ipad mini while traveling and has iphone 4.  Am using iphone4S with laptop and Dell computer, No apple product is  more than two years old.
    Am having the problem in using wifi on the 4S after it  was upgraded to the latest ios as per the recommendation by your  software of my iphone 4S 
    The wifi card hangs up at  it's own will and even a visit to your authorized service center in  Delhi has not able to help me although they have reverted the ios back  to the
    one supplied with the set. Am a user and not a computer expert but it looks like the wifi card is  not able to some times take the load while working which could indicate  the wifi card is getting heated up.   
    My daughter  who is Masters in 3D Animation is an ardent fan of apple products  working at present in Canada was also gifted by me a 4S about 4 months  back. My daughter-in-law is using iphone4 and an ipad for her professional  works along with a Dell PC in the US. While my son is a fan of samsung  products and does not like an apple product. 
    So in a family we have 7 apple products except MAC laptop/PC. 
    But the fact is, this problem with 4S has  really shaken me up and now it seems your products are deteriorating in  quality while demanding the best pricing structures. 
    Since  this is purely the device and the software of apple problem you may  please replace this set with new one as neither have any time to push  you/ request you after your service centre
    in Delhi told me yesterday this cannot be repaired.   
    The  serial No of my set is DN*****TC0 and was bought from an authorized  dealer and so were the other products from the same dealer in Delhi.  This set is still in showroom condition and
    was never used without a protective cover. 
    Thanks 
    Ashok Dhingra
    D E E Hons B E Tech MBA
    Vasant Kunj Delhi
    <Personal Information Edited by Host>

  • I have a new Mac Mini and all my software is up to date. My video keeps acting up, flashing and not allowing me to work. This was happening with my old machine as well. Is this a problem with my monitor or do I have a bug somewhere in  my system?

    I have a new Mini and updated software. My monitor will keep flashing back and forth, shrinking the display and not allowing me to work. Sometimes clicking the mouse helps, sometimes clicking into the screen but it freezes up and won't allow me to work. Is this a monitor problem or is there some bug in my system.

    Try just holding down on the power and home buttons to restart it. Thomas R. doesnt know what he was talking about. The tool is not made for jailbraeking and is not related to jailbreaking. If you want to get the link again, let me know, as I reapir iPhones, have been using it for years, nad it does NOT void your warranty. It simply reboots your device.
    My apologies for all of the new people on this site who are novices to anything beyond iTunes or the device itself. Hopefuly your problem is solved.

  • My netflix account used to work, but now it does not. Only the "my account" page is accessible and not the main page. Major problem. Please help. I'd rather run an older version than one that doesn't work.

    I believe I was running a 6.3.as.df,msad.f,masdf version of Firefox and my Netflix account was working wonderfully well. I happened to hit the quit button last time, instead of the save and quit button and for some reason, Netflix did not load properly. I cleared the day's history, as usual, and tried again. This usually works. I closed Firefox and tried to reopen it, but it said Firefox was already running, that I would have to restart my computer to solve the issue. I did that twice. Finally, I noticed Firefox was trying to download a new version -- even though I don't recall asking it to do so. Now I'm running 7.0 and my Netflix page doesn't work. I am logged in - great - but I can only access "My Account and Help" page and "Viewing History" but nothing else. Lame! I would love to know how to get this to work. I can't even pull up Netflix's main page on its own. All other websites seem to be working properly. PLEASE ASSIST!

    If this were just a Netflix problem, why can I access Netflix through Internet Explorer and not through Firefox? I've been using Firefox to access Netflix for at least the past year and starting yesterday (12/6/11) Firefox doesn't seem to recognize that Netflix exists. I've tried the suggested Firefox "help" which was of no help whatsoever and may even have made life more difficult in accessing other accounts. Anyone know how to contact Netflix or Firefox by phone?

  • When trying to creat a desktop icon, it does not go to the URL.....instead I get 'script' and not a website......the script has http//etc but I am not directed to the website......I previously had IE 8 (on Vista).....is that the problem...

    Question
    When trying to create a desktop icon, it does not go to the URL.....instead I get 'script' and not a website......the script has http//etc but I am not directed to the website......I previously had IE 8 (on Vista).....is that the problem?I do not have any installed plugins....at least none that I know of.....remember I am a new user......Basically, the desktop icon is not going directly to the Mozilla FF to get me to the web site I need to go to.....FF works when I use the Mozilla FF icon.....just not the icons I create.....THANKS!!! I have also tried reinstalling FF and get the same results.....HELP!!!

    The address beginning with file:/// denotes a saved file (local file). The file may not be present. You can try dragging the site icon of this page on the left edge of the location (Address) bar and release it on the desktop. Please try opening it. If it still shows an error it could be a problem with the system's zone permissions. You can try setting each zone in the Windows Control Panel or IE > '''Internet Options''' > '''Security''' tab to '''Default Level'''.

  • I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    I have a problem with itunes when I sync the saved music and want to sync my iphone 5 ios 7.0.6 no longer passes the music thing is that just stays on "waiting for sync" and not worry please help are more than 400 songs that do not want to hear who are wi

    Plawexki wrote:
    ...  do you know if the contacts, photos, messages etc will be wiped?
    Yes... Everything will be Wiped and Replaced with what is currently on Your Mac.
    SYNCING with iTunes
    See here  >  http://support.apple.com/kb/HT1386
    From Here  >  http://www.apple.com/support/iphone/syncing/
    You may find this information of interest...
    Have a read here...
    https://discussions.apple.com/message/18409815?ac_cid=ha
    And See Here...
    How to Use Multiple iDevices with One Computer

  • How do I determine if the memory problems are with my imac and not the RAM?

    I've heard of some vague problems with intel imacs and their memory slots. I'm about to replace (for the 3rd time) RAM, and think I need to test further to see if the problem is with my imac and not the RAM. Right now I put back in the original 2-512 sticks that came with the imac, and the rember test is only showing 594mb (odd amt!) testing OK. But, in "about my mac" it will show as 1gb.
    Problems I've had with each set of RAM: occasional KP's, excessive spinning beachballs, sudden closing of apps (esp. if I have several apps running), won't fax usually (will hear a fax tone instead of a dial tone at the onset), disappearing documents section under my username.
    I bought this imac refurbed thru the apple store last fall: 2.16 C2D 20" imac
    Any ideas before I have to separate myself from my imac to send it in??

    Hi Toodles
    The pin strips on the new modules maybe a little thicker than your original modules, and it's going to take more force to seat them properly. If the new Memory Specifications are correct I would try them again. Slide them in untill they stop, then push real hard untill you feel them seat into place.
    I've never seen a report about an odd amount of ram shown. If reinstalling the ram modules does not solve your issue, and may be a indication that there is something wrong with one of the slots.
    Dennis
    17" iMac Intel Core Duo - 2GB Ram -   Mac OS X (10.4.10)   - Maxtor 300GB FireWire - Creative Inspire 2.1 - 2G Nano

  • When I turn on my iphone4s, the apple logo will show for a few seconds, and it will suddenly fade off to a blank screen, and not start up. It will then restart by itself, and the cycle repeats. Any suggestions on how I can troubleshoot this problem?

    Hi all,
    I need help with my iphone4s.
    When I turn on my iphone4s, the apple logo will show for a few seconds, and it will suddenly fade off to a blank screen, and not start up. It will then restart by itself, and the cycle repeats. Any suggestions on how I can troubleshoot this problem?
    What seems to be the problem here?
    thanks and regards
    Wan

    Wanlucg wrote:
    When I turn on my iphone4s, the apple logo will show for a few seconds, and it will suddenly fade off to a blank screen, and not start up. It will then restart by itself, and the cycle repeats.
    Make sure you have the Current Version of iTunes Installed on your computer
    iTunes free download from www.itunes.com/download
    Then See Here  >  http://support.apple.com/kb/HT1808
    You may need to try this More than Once...  Be sure to Follow ALL the Steps...
    Take your time... Pay particular attention to Steps 3 and 4.
    After you have Recovered your Device...
    Re-Sync your Content or Restore from the most recent Backup...
    Restore from Backup  >  http://support.apple.com/kb/ht1766

  • 2 problems, iPod nano battery depleted and not recognized by Windows, help!

    Earlier this morning. At first when I connected the usb to the computer I got the screen in the nano that said "apple.com/ipod/support" or something like that, with the folder/exclamation mark icon. It was charging but I disconnected it cause I had to go. I tried to do the same at night but this time is when it's totally dead, and not recognized at all. What can I do now?
    I havent used the nano in a while and the battery is depleted, so I tried to charge it but neither windows or itunes or the updater/restore recognize it.
    I'm on a laptop, I already tried most of the stuff in the faqs but it wont work.

    i kind of have the same porblem, my klaptop does regcognize the ipod on "my computer" but the iPod dosen't shows up in iTunes, and i have tried almost everything in the faq that show how to fix the problem, but it still dosen't work....

  • My wireless keyboard no longer connects with my iMac since changing the batteries. It now shows as not connected, not paired and not configured. A friend recently connected his iPad to the iMac and since then the problem started. Any ideas to resolve this

    My wireless keyboard no longer connects with my iMac since changing the batteries. It now shows as not connected, not paired and not configured. A friend recently connected his iPad to the iMac and since then the problem started. Any ideas to resolve this?

    a friend told me that he wants my os x cd for my macbook pro to upgrade his imac.
    The discs that come with your Mac are "machine specfic" and cannot be used on another Mac.

  • Mail and Notes problems in Mavericks

    I've just installed Mavericks and I'm instantly having problems with Mail and Notes. To wit:
    1) Prior to the upgrade, I had dozens of messages flagged. Now, almost no messages show up as flagged.
    2) Some Smart Mailboxes now only display only a handful of messages, when before the upgrade some of those boxes contained dozens, if not hundreds of messages.
    3) Now that Notes has been separated from Mail (I skipped Mountain Lion altogether) I can't get my iCloud notes to sync to the new app.
    Any guesses or advice?
    Thank you,
    Jeff

    Hello Oskar98,
    Thank you for the details of the issue you are experiencing when importing video from your camera into iMovie.  I was not sure of the exact steps you took to import the video footage, and I wanted to provide the steps to confirm you are following all the steps.
    Try importing the footage from your camera by clicking on the link that refers to your camera type and following the steps in the related article:
    To create movies in iMovie, you must import (transfer) your video footage from your camera to your Mac. You can import from most types of cameras, including:
    iPad, iPhone, or iPod touch
    File-based cameras
    Tape-based cameras
    You can find additional information about importing at the following link:
    iMovie (2013): Importing overview
    http://support.apple.com/kb/PH14670
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How you can solve a problem or find out on a dead pc if the problem relies on motherboard and not on processor or vice versa

    hi.
    I am working myself with computers ,  so there is one thing in my mind I wanted to be sure,which I couldn't find an answer for it!
    because I had before totally black screen and the problem was damaged processor.
    I am wondering how I can be sure as the last option when I get a black screen and there is no lihgts at all no any LED is lighting.totally dead pc.
    how  you can be sure then that the problem relies on processor and not on motherboard or vice versa the problem relies on motherboard and not on processor
      because I can't say to the customer lets buy first a processor if it is the cause of dead PC and if not then we buy motherboard. this sounds not wise.
    so I experimented first with my latop ,I pulled out the processor to see if I can see any LED light or any movement on the motherboard to be sure that motherboard giving me some clue that it is healty. I gave some light heat to de fan to let it turn ,because 
    it is working with heat sensors then I know that the motherboard is healty. but it didn't work. 
    I did the same with my desktop computer and the result is the same no any lights and no any movement on the motherboard . so now can some one tell me how you can distuingish as a last result which of this 2 components is causing dead PC. is there any
    tool to test the motherboard or how asus,dell ect. they solve such a problem if the customer send to them a dead pc.
    I know that the power supply also can cause dead pc but I know how to solve a problem  with dead power supply. and I want to keep away power supply from this question. please do not tell me that  Idon't have to pull out processor
    because I am a technician and both of my computers are doing very good after this experiment.
    thanks
    johan
    h.david

    Usually if you have some kind of hardware failure there is some beeping during POST or most motherboards now have LED indicators to produce and error message based on the type of failure
    So if its bad memory, not place properly, mismatched, processor not inserted properly, mismatched voltage or voltage connector not present etc it beeps or generates the error id.
    Power supplies can be tested for failure. There are some walk throughs for testing just them with a switch, paperclip or a jumper (I'd suggest not doing this if you are not familiar with the dangers of electricity).
    Memory can be tested with memory diagnostics programs like Memtest+
    Processors can overheat if the proper precautions have not been taken usually you will get a POST beep or error code for that.
    If the motherboard has no response then do the basics first:
    Check power connectors and power supply. Once you determine that is not the case move on to other items like graphics cards in all the way or memory.

  • My notes from my iphone4 have been deleted. Heres the problem, the reason it is deleted is because i accidentally deleted my gmail messages. i guess my notes were there to. the notes are not in icloud and not in gmai. is there any way i can get them back?

    My notes from my iphone4 have been deleted. Heres the problem, the reason it is deleted is because i accidentally deleted my gmail messages. i guess my notes were there to. the notes are not in icloud and not in gmai. is there any way i can get them back?

    Qualdog-12 wrote:
    My friend deleted some of my apps from settings as a prank, and I can't get them back by using the App Store.
    if they are no longer in the app store, you can not get them back.

Maybe you are looking for