Query running, and never ends, need guidance

I am trying to track down 64 Id's that are not in one table and cannot seem to get the query right. I am in need of some guidance if anyone can help
I have joined two tables in one query:
SELECT line_item.ID
  FROM sforce_opportunitylineitem line_item, sforce_opportunity opp
WHERE line_item.opportunityid = opp.ID
   AND line_item.part_outcome__c = 'Won'
   AND opp.TYPE <> 'Production'and that gives me 61957 ID's
Now that ID is a field on another table called oli_id__c
SELECT oli_id__c
FROM sforce_design_winwhich gives me 61893
A difference of 64 records and the Id that I am trying to find for reporting
I tried to combine the two using NOT IN and the query just runs and runs and runs and never finishes.
Any help would be appreciated
here is the full query:
SELECT line_item.ID
  FROM sforce_opportunitylineitem line_item, sforce_opportunity opp
WHERE line_item.ID NOT IN (SELECT oli_id__c
                              FROM sforce_design_win)
   AND line_item.opportunityid = opp.ID
   AND line_item.part_outcome__c = 'Won'
   AND opp.TYPE <> 'Production'can someone help me out
TIA,
Mike

There is a fancy word for this something like a large result set for your second predicate or something, but I would try a not exists or a minus since the result sets from both the queries are larger:
SELECT line_item.ID
  FROM sforce_opportunitylineitem line_item, sforce_opportunity opp
WHERE NOT EXISTS (SELECT 1
                              FROM sforce_design_win b
                              where b.oli_id__c = line_item.line_item.ID )
   AND line_item.opportunityid = opp.ID
   AND line_item.part_outcome__c = 'Won'
   AND opp.TYPE <> 'Production';or
SELECT line_item.ID
  FROM sforce_opportunitylineitem line_item, sforce_opportunity opp
WHERE line_item.opportunityid = opp.ID
   AND line_item.part_outcome__c = 'Won'
   AND opp.TYPE <> 'Production'
minus
SELECT oli_id__c
FROM sforce_design_winHere's a conversation from Tom Kyte talking about the use of exists vs. in:
http://asktom.oracle.com/pls/asktom/f?p=100:11:506495961445515::::P11_QUESTION_ID:953229842074
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:442029737684
Message was edited by:
JoeC

Similar Messages

  • When I open iTunes , iTunes Match started to process step 1. Always same process and never ending

    When I open iTunes , iTunes Match started to process step 1. Always same process and never ending...
    I tried some suggestions but I cant fix my problem. Do you have any knowladge about this problem?

    For the past few months, and several iTunes upgrades, iTunes Match spends some time in Step 1 "Gathering" and sending information to Apple. Then Step 2 runs through the first 2092 of 2094 pretty quickly. Jumps to 2094. And then immediatly back to Step 1 again.
    Repeat every 5 minutes or so until Match is manually turned off.

  • Warp Stabilizer analysis process stopping and never ends (AE CC 2014)

    I'm running the latest 2014 AE CC and I've been getting this issue running Warp Stabilizer on my clips.  Intermittently, warp stabilizer analysis process would stop at certain frame and never ends.  I have to quit / kill AE.
    I'm running AE on 15" retina macbook pro 2013 with dedicated nvidia 750M video card, 16GB of RAM and plenty of disk space (over half a terabyte left), running Yosemite 10.10.2.
    Has anyone experienced this?  How do I solve this issue?

    "During the analysis and solving stages, the Warp Stabilizer effect and 3D Camera Tracker effect use memory outside of the pool shared by After Effects and Premiere Pro. Therefore, you can allocate more memory to the analysis and solving phases for these effects by increasing the RAM Reserved For Other Applications value in the Memory & Multiprocessing preferences."
    Thank you for that link.  I'm going to check the "RAM Reserved For Other Applications" and increase the value if it's too low.

  • Hello, all of a sudden without apparent reason I can't get "MAIL" to function. It starts up but I get the color wheel turning like crazy and never ends. I've tried restarting and I still can't get it to work. PLEASE HEEELP!?

    hello, all of a sudden without apparent reason I can't get "MAIL" to function. It starts up but I get the color wheel turning like crazy and never ends. I've tried restarting and I still can't get it to work. PLEASE HEEELP!?

    In the Desktop Manager > Sync > Configuration, make sure the calendar options are set to override Outlook.
    Set it also to notify you of the changes, so you will have to approve any changes.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • In the last 4 days, whenever I go off the internet and then click on Mozilla to go back on the internet I get a message that says that I have to close Firefox or restart the computer; however, Firefox is not running and I end up having to restart my compu

    I go on and off the Internet several times every day. In the last 4 days, when I go off the Internet by "x" ing out Firefox and I then later in the day try to go back on the Internet, I get a message that states something to the effect that Firefox is running and I need to either close out Firefox or restart the computer. I always end up having to restart the computer.
    == This happened ==
    Every time Firefox opened
    == In the past 4 days

    Try the solutions at http://support.mozilla.com/en-US/kb/Firefox+hangs#Hang_at_exit

  • My fan keeps running and never stop

    my laptop is dell studio 1458
    the system is the latest archlinx x64, and now i am using kde 4.6
    the problem is that the fan of my laptop keeps running all the time and never stop.
    Is there any solution to this problem?
    Thx...

    The warning is there so that people realize they need to be aware of the possible outcome if they don't properly check their fans during the setting up of the software.
    The guide even suggests to keep a constant watch on the CPU's temperature during testing, and suggests how you can immediately spin up the fans to max in case of a too high temperature:
    Second warning: Some of the steps outlined below describe how to tweak fan speeds. Before doing this be sure you have a low cpu load and are comfortable playing around. If at any time during tweaking you notice the CPU temperature start to rise dramatically, do a echo "255" > /sys/class/hwmon/hwmon0/device/pwm1 to spin up the fan all the way until things cool down. Basically, you should know what you're doing before fooling with the configuration file.
    Alternatively, there's a fan control deamon called dellfand. A related topic can be found here:
    https://bbs.archlinux.org/viewtopic.php?id=54865
    Essentially, all these tools do the same. The temperature is polled and the fan speed is adjusted.
    As far as I know, there is no alternative way / graphical tool to do this for you.
    *edit*
    considering this is a dell studio, have you checked the system's bios to see if the automated fan control is enabled?
    Last edited by stefanwilkens (2011-04-29 13:03:18)

  • Keynote is not repsonding , how do you get it to open a powerpoint that is not Keynote is not respond to. It just runs, and runs and never opens, and I have to force quit.

    Keynote is not responding.When I click on Keynote Powerpoint presentation icon that is saved on my desktop, it just runs, asnd runs, and runs. I heve to force quit it. I'v never had this happen before. Never had this problem until last night when it would run and run and run. What can I do to open this powerpoint presentation?

    I had this same problem as well. The original file had been converted from PPT, and it just got to a point where, while opening, the beach ball would just spin and spin and...
    I followed some advice I saw posted somewhere, as follows:
    1) Delete everything that is inside of Library/Caches and also ~Library/Caches; i.e., the one is accessed through "Macintosh HD:Library:Caches" and the other, ~Library:Caches folder is accessed by going to the Finder's  "Go" menu and holding down the Option key. Delete everything inside each of these Caches folders.
    2) Restart the machine and hold down all 4 keys of Command + Option + P + R while starting up, until you hear two bell chimes. After the 2nd bell chime you can let go. This resets the parameter something or other.
    Open up Keynote and open yoru file. Should work. Worked for me.

  • I continually get the Update message and when I click it runs and never completes update. This has happened everytime I log in.

    Whenever I log in on my computer, I get a Firefox Update message and when I click on it it continually runs for hours and never completes the update.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 4.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Firefox 3.6.x: http://www.mozilla.com/en-US/firefox/all-older.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the [http://kb.mozillazine.org/Profile_folder_-_Firefox Firefox Profile Folder], so you won't lose your bookmarks and other personal data.

  • When I click on retrieve update, It continues running and never retreives update, why?

    I have never been able to update firefox, because it can't. retrieve the update. When the box appears and click on update, It runs and runs without succeeding. When I have tried to get help with this problem before, there was no response from firefox. What to do????

    If there are problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the disk image (dmg) file to the desktop
    * Firefox 6.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • I am syncing my Iphone 3 to my mac osx and once it starts syncing my bookmarks it just keeps running and never finishes syncing

    I am syncing my iphone 3 with my mac osx 10.5.8  and it gets stuck and never gets past syncing bookmarks.  How can i fix this?

    ChipGore,
    I am having the same issue on "There is no indication that syncing calendars is even an option in iTunes, and there used to be! (not happy right now)"
    My MacBook Pro running on OS X 10.9.1 won't even sync calendar with my iPhone right now.
    Have you got a solution yet?
    Gideon

  • Export just hangs and never ends

    I am having an Oracle 9.2.0.6 STD edition in WIN2003r2
    The export job was runnig fine but suddenly it starts to hang when it reaches
    Exporting cluster definitions.........
    It never ends
    I have an invlaid XML object....
    Any suggestions...
    Message was edited by:
    Maran Viswarayar

    can u please post what are the paramaters u have given while exporting.
    Regds
    Nirmal

  • FI-AA : Problem in Depreciation Run and Year end closing.

    i am doing asset year end closing and new fiscal year open, i followed the steps as followings..
    Step 1 Did depreciation run using T-code AFAB- no error
    step 2 checked depreciation run in AFAR was correct(no error)
    step 3.did actual run of new fiscal year open using tcode AJRW.
    step 4 : did actual fiscal year closing t-code AJAB.
    but now the problem is still i am not able to see any asset reports when open the report meg. says "fiscal year change not done for company code xxxxx"
    problem due to  is any patch need to be executed? or due to any other application error?, pls advice to solve this my issue.
    with best regards,

    Hello
    Choose Periodic processing ® Fiscal year change.
    Enter the company code and the new fiscal year.
    Choose Program ® Exec. in background.
    Process the assets with errors that were identified during the fiscal year change (Tools ® Assets with errors).
    Reg
    *Assign points if useful

  • OBI EE Delivers - iBot running..never ends

    Hi all,
    I installed OBI EE and followed all of the instructions to set up Scheduler, Job Manager and so on.
    I was able to submit an iBOT "immediately", setting as destination DASHBOARD,
    but in Job Manager the submitted iBOT remains "running" forever,
    therefore the "Alerts" link never appears in the dashboard.
    I also looked at the database sessions, but I cannot see any active session related to the iBOT.
    I even gave DBA privilege to the S_NQ_SCHED database user,
    but it seems to be useless.
    I also started the Oracle Job Scheduler service (my pc o.s. is Windows XP)
    but it does not help.
    Any clue ?
    Thank you,
    Silvio

    As I Stated earlier - (Turribeach)
    -- --- From Earlier post -------
    I look at 'My Account' for my Dummy obi ee user and I see 3 System Emails listed.
    But when I view them they all have the same email address.
    But in the SA_SYSTEM_USER table I have 3 completely different email address/records.
    Again, I will state, in the SA_SYSTEMS Table I have 3 completely different emails!!!
    This was my insert statement:
    INSERT INTO S_NQ_SCHED.SA_SYSTEM_USER (EMAIL, GROUP_NAME, LOGON_NAME, DISPLAY_NAME)
    VALUES ('[email protected]','Dovico Group2','DOVICO_GROUP2','User Name3');
    INSERT INTO S_NQ_SCHED.SA_SYSTEM_USER (EMAIL, GROUP_NAME, LOGON_NAME, DISPLAY_NAME)
    VALUES ('[email protected]','Dovico Group2','DOVICO_GROUP2','User Name1');
    INSERT INTO S_NQ_SCHED.SA_SYSTEM_USER (EMAIL, GROUP_NAME, LOGON_NAME, DISPLAY_NAME)
    VALUES ('[email protected]','Dovico Group2','DOVICO_GROUP2','User Name2');
    To my understanding, and this is what I would like assistance with. Is if I have 3 DIFFERENT emails address in the SA SYSTEM table, shouldn't the 3 different emails be listed in the DOVICO_GROUP2's "My Account" ?
    Instead, I get 3 emails listed, but when I view them they are the same one.
    Again, assistance would be appreciated.

  • Worksheet gives gray background on query run and won't give back.

    When I run either multiple queries within a single worksheet or an running any code over 1 line long, the worksheet highlights the entire query with a dark gray background, just like the old Tora or Toad, which is fine. However, unlike Tora or Toad, it doesn't give me back my white background when I click on the query...hence I can't see any of my comments(they are gray when they are on the white background). This is about the only reason I don't like using this software. I use a lot of comments. I have found that if I Ctrl-A and then run, it doesn't do the gray background...however very annoying if it does it. Any help would be appreciated. Thanks.

    Goto tools, preferences, Code Editor, Syntax Colors and change 'Current SQL' to something more pleasing. You also probably want to change the foreground color for current sql to transparent.
    Hope that helps
    Eric

  • Mail and never ending spinning pinwheel of death! Help!

    I'm running 10.5.6 on my 24'' aluminum/glass iMac, and when I open mail, I instantly get a spinning pinwheel of death that doesn't go away. I then have to force quit Mail, and if I open it again, the same thing happens.
    This definitely *****, how would I go about re-installing mail? Is that the solution?

    You don't need to reinstall mail, however, I do thing you need to reset it.
    This is how you do it:
    Quit mail (force quit it if necessary)
    Delete the following files:
    ~\library\Preferences\com.apple.mail.plist
    ~\library\Preferences\com.apple.mail.RSS.plist
    Move the folder Mail from ~\Library to your Desktop
    Launch mail. It will ask you to configure a new account, if it doesn't click on the Mail menu\Preferences\Accounts\(+) to add a new account and follow the on screen instructions to add an account. if you don't know how to add an account follow this tutorial:
    http://grumpynet.ath.cx/tutorials/configuremailforleopard/configuremail.php
    If you need help finding the settings for your ISP check out this link or call your ISP:
    http://grumpynet.ath.cx/Articles/Mailservers/mailservers1.php
    After doing this you should have your mail working normally again.
    NOTE: if you have folders created in your computer you can recover them by copying the Mail folder you moved to the desktop earlier into ~\Library and replace what's there. The folder ~\Library\Mail contains all your email messages and attachments, you can browse it and take a look at its structure if you want, is actually pretty cool and can help you understand how you can recover messages in the future or from another computer
    NOTE 2: the term ~\ means your Home Folder (the folder with the icon of a house and your user name under Places in Finder)
    I hope this help you fix your problem. Please post back to let us know if this fixed your problem or if you need more help

Maybe you are looking for

  • Problem in error table of BAPI_BILLINGDOC_CREATEMULTIPLE

    Hi all I am using BAPI_BILLINGDOC_CREATEMULTIPLE and passing all the values correctly. I am getting values in error and return tables, if there are any errors. My problem is that, suppose for an order there are 2 line items. Then for the line items t

  • How to Limt Standard Text through Javascript

    Hi, I have an urgent requirement , I need to print only 2 lines of Text entered in the Header/Item Text in PO. When the text exceeds more than 2 lines I need to truncate the rest. I am using an include text for this. I hv tried limiting the char / al

  • My apple tv keeps flashing between apple logo and start menu?

    I had to reset my Apple tv due to it was frozen, so I with reset it to original facorty setting. After this was done I followed all on screen instructions, finally I was done, I reset my wi fi setting and went to start menu, it would hold on the star

  • Adding jumbo frame support into an existing Ethernet network

    I have a remote site with 40 users that connect back to our main site via two point to point T-1’s. These users connect to an Exchange server (DMZ), Sybase databases on Sun servers (Internal network), and access the Internet via the main site. I have

  • After upgrading iTunes on iPhone4, text displays as squares

    After upgrading iTunes on iPhone4, the text is displaying as squares and symbols. Does anyone know how to fix?