I must be the most simple update query!

Hi all

I'm trying to run an update query that should be simple, that he gets, an inner join between two tables setting the value of a column non-joining tables to the value of the other tables non-joining column:

SQL > update compound c
2 set cmpname =)
3. Select xname
temp_foo 4 f
5 where c.cmpcorporateid = f.xcorpid);

146917 lines to date.

Problem is that temp_foo has only one record and that only one record is a record in the compounds. How to limit the search to this record?

Thanks for any help!

Hello

Since you do not have a WHERE clause in the UPDATE statement itself, all rows will be modified.
Try this:

update  compounds      c
set      cmpname = (
            select  xname
            from        temp_foo     f
            where   c.cmpcorporateid = f.xcorpid
            )
-- From here down is all new
WHERE   xcorpid IN (
             SELECT  cmpcorporateid
             FROM        temp_foo
             );

If you think that's duplicate most of the work of the subquery, you are absolutely right!
You can use the MERGE command to avoid this kind of duplication.

Tags: Database

Similar Questions

  • The most recent update 9.3 works on iPad 2?

    I had to restore iPad 2 2 at the factory after the first update 9.3 settings. The most recent update work?

    He does. However older devices, in particular the ipad 2 have had problems. First to not being not able to activate, not then the fix for which focused on the problems with Safari and links in emails.

    So if you had problems, you're in good company.

  • The most recent update of Skype broke echo cancellation

    Hello

    I've been using Skype for years now with a webcam, a microphone and speakers. Sometimes during calls the other person would hear themselves (it is to be expected that the mic picks up the sound input of the speakers), but it was still deleted by the echo cancellation feature.

    The most recent update it completely, because there is nothing and there's always some echo. You use a headset is a solution, but it does not address the underlying issue, as this is clearly focused on the software and has worked fine until the last update.

    Are developers aware of this problem and is at - it a 3rd party software that can help with this in the meantime?

    Meanwhile, the party that generates the echo can proceed as follows:

    1. use headsets. This should completely solve the problem of echo (unless there is a hardware problem).

    2 turn down the volume and verify that the speakers are not to the MIC.

    3 use echo cancellation software like SoliCall Pro.

  • can someone help me to get rid of software malware the most simple solution

    in desperation once again

    can someone help me to get rid of software malware the most simple solution

    I recognize you from the other thread! I suggested that find you a good PC Tech seems like you always want to try this on your own for now. :-)

    Have you tried this yet:

    http://supportservices.Microsoft.com/support/services/virus_malware_removal

  • I have photoshop creative suite cs3 for PC. I want to make the transition to Mac products. What is the most simple/less expensive way to do it?

    I have photoshop creative suite cs3 for PC. I want to make the transition to Mac products. What is the most simple/less expensive way to do it?

    Your PC suite has no impact on it, as it is too late for upgrade prices. Simply purchase you a new subscription to creative cloud.

  • I have 12 items. I just downloaded the most recent update. It will not open the RAW files from my Panasonic TZ70?

    I have 12 items. I just downloaded the most recent update. It will not open the RAW files from my Panasonic TZ70?

    See the faq for the compatibility of ACR:

    FAQ: Photoshop Elements will work with my camera, or why does not open my raw files?

    Your camera would need ACR version 9 which is not supported by 12 elements.

    You can:

    -upgrade to 13 items, with updates of version 13.1.1

    - or use the free DNGconverter mentionned in the links at the bottom of this faq. You'll be able set of entire folders to convert your raw files to DNG PSE12 can read and modify.

  • I'm in the most recent update to LR CC. My tools are acting funky. Any help for a beginner?

    I'm in the most recent update to LR CC. My tools are acting funky. The button "done" when the adjustment tool is open is missing and is editing with the Red overlay and not showing me the effect. I'm failr again to the present. Any help for a beginner?

    Try to press T to activate the toolbar. Maybe the toolbar is disabled and that's why you don't see the Finish button.

  • We use Adobe Acrobat 10. When I try to download the most recent update, I get the message error 1608 download failed. How can I fix it.

    We use Adobe Acrobat 10. When I try to download the most recent update, I get the message error 1608 download failed. How can I fix it?

    Uninstall acrobat, clean (if windows os), Download Adobe Reader and Acrobat cleaning - Adobe Labs tool , and then reinstall.

  • The most recent update of vista

    I was working on my computer a few days ago, and the little thing goes out that there is an update to windows. (I have vista) This is my first and biggest problem ever. It corrupted my id user so all my itunes songs and school papers and locked and I can't get to them. I called Dell and they say I'm out of warranty (I'm trying to find my reciet cause the computer is not the age of 3 years) and basically, they told me that I can pay $100 an hour for them to try to fix or buy a Mac next time! Seriously, they did! I heard many of my friends have similar problems. Dell said to remove the update will not help either. Can someone help me?

    My school work is very important and I have far too much money invested in itunes to make it let go. Seems that my external hard drive does not have to save it at all...

    Melesifant

    Restore point:

    Try typing F8 at startup and in the list of Boot selections, select Mode safe using ARROW top to go there > and then press ENTER.

    Try a restore of the system once, to choose a Restore Point prior to your problem...

    Click Start > programs > Accessories > system tools > system restore > choose another time > next > etc.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If the above does not work:

    http://windowshelp.Microsoft.com/Windows/en-AU/help/769495bf-035C-4764-A538-c9b05c22001e1033.mspx

    Difficulty of a corrupted user profile

    After creating the profile, you can copy the files from the existing profile. You must have at least three user accounts on the computer to perform these operations, including the new account that you created.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    If you manage to get into your computer:

    Here is here to remove the updates, change the settings for updates, etc.:

    Click Start > right click on computer > properties > Windows updates down the lower left corner > updates installed in the lower left corner in the next window

    > then click the one that you don't want > uninstall will appear at the top > uninstall it.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    In addition, on the page where you clicked "Installed updates", click on change settings at the top left corner it

    > Change update settings in the next page of AutoUpdate to "check for updates but let me choose etc" > OK ".

    When you take a look at pending updates, you can either download/install them one at the time, namely the update causing you problems.

    > or if you do not need an individual > right-click on > UAC prompt > hide it

    Post back with update KB number, you are having problems with.

    See you soon.

    Mick Murphy - Microsoft partner

  • Need to do system restore after you perform the most critical updates

    Since getting internet cable in January, and the creation of a network, I couldn't install more updates to Vista security on my laptop Dell for 5 years.  Every time I have download and install, the next time I start my PC, repair Windows startup program is displayed because Windows cannot start.  The only solution never finds it is to do a system restore, which of course gets rid of all the updates of security that I just installed.  An exception to this rule are the updates with a tool to remove malicious stuff.  Those who work.  And my works of Bit Defender.  But I'm heading out for big trouble not being able to do all the other critical updates?  What do you think is the problem?

    What type of Internet connection you are on, wired or wireless? If you are on a wireless connection, try to switch to a wired connection and try the download with Internet Explorer.

    I suggest you to install the updates one by one and...

    See this response archived from a previous thread:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/thread/9b7aafc2-5e3c-4d2D-BC01-4b81d319922a >

    NOTE: any changes you make now will NOT affect updates already in the queue of the installation. For which is concerned about the automatic updates, you have already approved these updates.

    UTC/GMT is 07:30 on Tuesday, may 1, 2012

  • Sony VAIO Windows 7 can not get the most recent updates

    I have a Sony VAIO - VGN - Windows 7 and I can't seem to get 2 errors updates received up to this most recent need help in simple English please because. I am not computer savy and have spent more than 2 hours (really) trying to get windows answers continue to send from one place to the other. So far, I received 3 error 80080008-codes-50597-80070652 trying to get answers please help.

    Try the new June included in this update rollup, update client

    https://support.Microsoft.com/en-us/KB/3161647

    Main download page,

    https://support.Microsoft.com/en-us/KB/3161608

    Win-7 32-bit

    https://www.Microsoft.com/en-US/Download/details.aspx?ID=52976

    Win-7 64-bit

    https://www.Microsoft.com/en-US/Download/details.aspx?ID=52974

    Don't forget to change your windows update settings to never check the updates, and then restart the computer before installing.

  • Why the most recent update put all my plug-ins to activate and deactivate an Adobe one?

    Update of Firefox and none of my plugins worked up to that I went and changed ask to activate to always turn on. This plug-in NPAPI of Adobe Acrobat says it must be updated, but when I try it does not update. She finds the same need to screen update. There is a problem with your last update.

    I tried to update the plug-in. I wouldn't. I solved the problem by uninstalling the new firefox and download an older version and make sure it has not installed the maintenance program. This prevents update. I even tried the firefox 31 beta and it put all plug-ins to ask to activate. Until you can solve this problem, I'll stay with the old version that works correctly.

  • Thus, after the most recent update, Skype will not be open to all

    I tried everything, but I can not Skype to open as much as now that I put it to date. Is it possible to fix this? I tried to uninstall and reinstall but hit the wall even.

    Try to update your Skype to the currently latest version of 7.29.0.102 :

    http://www.Skype.com/go/getskype-full

  • See installing the most recent update of Silverlight (KB979202).

    When you try to install the new update, I get an error "' Code 64 c: Windows Update encountered an unknown error." "

    Any ideas on how this problem can be solved?

    1 hide the update, and then...

    2 uninstall Silverlight & reboot, and then perform a new installation of the current version via http://silverlight.net/

    Or see...

    Need help? Post here: http://forums.silverlight.net/forums/13.aspx

  • Windows does not start after the most recent update

    I have 64 bit Vista and Office 2007. There was a group of updates for the latter in February 2011. Something in here is stop Windows at the login screen. Workes mouse and keys stick, but it won't take me to the password screen. Only way to get around it was to go in safe mode and do a system restore to remove the updates. Any suggestions?

    Applications, (Norton and McAfee) are notorious for not not upgrade (or uninstalling) itself.

    [You may want to print these instructions for reference offline. If a step said to reboot, reboot.]

    1. download the Norton Removal Tool, save it to your desktop: ftp://ftp.symantec.com/public/english_us_canada/removal_tools/Norton_Removal_Tool.exe

    2. close all open applications (that is, anything with an icon on the taskbar).

    3. After completing some you have a copy of your handy product key, uninstall all Norton software (including LiveUpdate and everything Norton Add ons) via Control Panel | Programs | Uninstall a program (or Control Panel |) Programs and features, if you are using the classic view).

    4 IMPORTANT! -Online activate Windows Firewall immediately after the restart.

    NB: Now you're "working without a net": no to ANYTHING else online (e.g., navigation, reading e-mail, chat) until you have completed step #7 below!

    5. right click on the file that you saved in step #1 above, and then select run as administrator.  DO TAP not your keyboard until the race ends, then restart.

    6. do a clean install of Norton 360 2011 (using your product ID, if need be) & reboot. CF. http://www.symantec.com/norton/support/kb/web_view.jsp?wv_type=public_web&docurl=20080514162318EN

    NOTE: Do NOT activate or install additional modules of Norton (for example, Norton Anti-Phishing) immediately.

    7. manually and repeatedly run LiveUpdate (Norton) until you get a prompt "no update more".

    8 reset the advanced settings of the IE by http://windows.microsoft.com/en-US/windows7/Reset-Internet-Explorer-settings

    9. open Internet Explorer (32-bit) only to http://support.microsoft.com/kb/971058 [ignore APPLIES to section] & run it in DEFAULT and modes difficulty then AGGRESSIVE. [1]

    10. restart once again & test.

    ~~~~~~~~~~~~~~~~~~~~~~~~
    [1] full Disclosure: the difficulty operating in AGGRESSIVE mode will remove your update history but not list the updates installed in Add/Remove Programs (Windows XP) or installed updates.

    ~ Robear Dyer (PA Bear) ~ MS MVP (that is to say, mail, security, Windows & Update Services) since 2002 ~ WARNING: MS MVPs represent or work for Microsoft

Maybe you are looking for