Problem with update of table (using the subquery to retrieve value)

Hello
I update a table based on the value of the subquery.
Here's the update statement.

UPDATING temp xm
SET xm.col1 = (SELECT DISTINCT col1
Of
(SELECT col1, col2 COUNT (col2)
FROM table2
WHERE col1 = xm.col1
AND col2 = xm.col2
GROUP BY col1)
where col2 in (select... in the table3)
)
WHERE xm.col5 = < value >
AND xm.col6 = < value >

When I run this statement I get following error.
ORA-00904: "XM". "" Col1 ": invalid identifier.

Can someone help me why I get this error?
Why doesn't the main table alias in the subquery?

Is it possible to avoid this / re - write the query in a different way?

Thank you

Published by: user552703 on November 2, 2009 20:42

You can nest only 1 level deep (referring to the table to be updated).

Have you looked at using the MERGE command? It is "easier" perform updates of this nature, assuming you are using a recent version of Oracle (9 or MORE).

Tags: Database

Similar Questions

  • Update a table using the clause

    Hello

    I want to update a table using the selected values.

    Cases in the sample:


    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Krishna Devi wrote:

    Hello

    I want to update a table using the selected values.

    Cases in the sample:

    create table as empsalary)

    Select 1 as empid, 0 in the wages of all the double union

    Select option 2, the double 0);

    Data update are as follows

    with saldata as

    (

    Select 1 as empid, 5000 as wages, 500 as double pf

    Union of all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    I tried the following query but does not work

    updated set of empsalary table (empid, salary) =

    (

    Select * from)

    with saldata as

    (

    Select 1 as empid, salary, 500 5000 as pf Union double all the

    Select option 2, 10000,1000 like double pf

    )

    Select empid, salary saldata

    ) sl

    where sl.empid = empsalary.empid

    )

    I use oracle 10g.

    Help, please.

    Thanks for posting creates table and test data.

    The error message would have helped because it's pretty obvious that this is the problem:

    Update table empsalary

    *

    ERROR on line 1:

    ORA-00903: invalid table name

    Just remove the word "table".

  • Problem with lines in Illustrator using the Wacom Tablet

    Hi all

    I have no idea why I'm having this problem in Illustrator. I use the small Intuos Pen Tablet (CTL-480), and my lines in illustrator is really strange. Even when I turn off the pressure in the brush settings, there is a gap in the line (it takes just one line of the same thickness). The Tablet works perfectly in Photoshop, but because I use the tablet to create art using plates (typography), it is easier and better for me to use illustrator. You are not sure that someone else had a similar problem or know maybe a setting I could change or try to fix it?

    I have attached a picture of the problem.

    Screen Shot 2016-05-06 at 7.58.21 PM.png

    Screen Shot 2016-05-06 at 6.46.21 AM.png

    Thank you for your help.

    This is a known issue.

    If all you want is a line single width, do not use brushes. Use the pencil tool and a simple blow

    If you apply a calligraphy brush, apply the effect zig - zag to it with a value of 0, then a setting of about 100 (turn on the preview to adjust)

  • Problem with Textfield autocomplete--&gt; only use the INSTR function

    Hello team dev,

    I use the new "textfield autocomplete" item type APEX and you have a crazy problem with it.

    I have a table with an index on the same column I want to search with AutoComplete field.

    Index:
    CREATE BITMAP INDEX TEST.GEO_DATA_IDX1 ON TEST.GEO_DATA (postcode)
    NOLOGGING TABLESPACE TS_INDEX;
    Select which is automatically generated by APEX 4:
    SELECT   a.*
      FROM   (  SELECT   DISTINCT postcode AS RV
                  FROM   TEST.GEO_DATA
                 WHERE   country_id = :P1_COUNTRY
              ORDER BY   1) a
     WHERE   INSTR ("RV", :p$_search_string) > 0 AND ROWNUM <= :p$_max_rows;
    
    -- plan
    Plan
    SELECT STATEMENT  ALL_ROWSCost: 4,308  Bytes: 45,31  Cardinality: 1,97            
         2 SORT UNIQUE  Cost: 4,307  Bytes: 45,31  Cardinality: 1,97       
              1 TABLE ACCESS FULL TABLE #TABLE# Cost: 4,306  Bytes: 47,311  Cardinality: 2,057  
    The APEX 3, I used the addon of Tyler Muth with my own Select:
    SELECT   DISTINCT
                postcode AS DV,
                postcode AS RV
         FROM   TEST.GEO_DATA
         WHERE   country_id = L_COUNTRY
         AND    postcode like l_search||'%'
         ORDER BY 1
    
    -- Plan
    SELECT STATEMENT  ALL_ROWSCost: 840  Bytes: 152,867  Cardinality: 13,897                                
         8 SORT ORDER BY  Cost: 840  Bytes: 152,867  Cardinality: 13,897                           
              7 HASH UNIQUE  Cost: 838  Bytes: 152,867  Cardinality: 13,897                      
                   6 VIEW VIEW index$_join$_001 Cost: 836  Bytes: 232,111  Cardinality: 21,101                 
                        5 HASH JOIN            
                             2 BITMAP CONVERSION TO ROWIDS  Cost: 31  Bytes: 232,111  Cardinality: 21,101       
                                  1 BITMAP INDEX RANGE SCAN INDEX (BITMAP) #INDEX#
                             4 BITMAP CONVERSION TO ROWIDS  Cost: 45  Bytes: 232,111  Cardinality: 21,101       
                                  3 BITMAP INDEX SINGLE VALUE INDEX (BITMAP) #INDEX#
    Is there a chance to get my INDEX used by the new element of the APEX? I do not. But I still want to ask before I just rebuild. :)

    Best regards

    Tobias

    Hi Tobias,.

    I guess that you are currently using "contains and case sensitivity ' to the attribute of"search ". Have you ever tried out "Exact and case sensitivity? Because that internally uses the LIKE operator as does your original query and the % is at the end, she must allow the use of an index. But it might still work, because ORDER BY can be run at a different time in your original example, but it's worth a try.

    Concerning
    Patrick
    -----------
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • JDeveloper 12.1.2 has a problem with links when you use the data bean control

    Build JDEVADF_12.1.2.0.0_GENERIC_130608.2330.6668

    The problem that I am facing is:

    I used the data bean control to create our user interface. After that I dragged my jsff page data control, links have been created.

    I opened the XML pagedef to my page. On the Bindings tab and executable, I added a few links more by clicking on the Green plus sign. After I saved my changes, I noticed that some other links have been replaced by a link to the different executable files.

    This behavior occurs almost everytime I have edit links. Does anyone else see this problem?

    It looks like another instance of the bug described in https://java.net/jira/browse/ADFEMG-156

    This bug is fixed in 12.1.3. If you need the fix in 12.1.2 you should open a SR with support.oracle.com and ask a backport.

    Timo

  • Problem with burning a DVD using the AVCHD format

    I just finished on a video project of 19 minutes (photos and short video clips), and I was able to burn it to a DVD in standard quality with first Elements 10.  When I try to burn AVCHD, however, I get an error just until it's ready to start burning.  It encodes all media and all switches to the menu burn when the "error" appears.  There is no other explanation.  I also tried to burn to a folder and I get the same result.

    I used the first items 10 for 4 years to do this same type of project, and I was able to burn on AVCHD successfully in the past.  Any ideas why it doesn't work anymore?

    Specifications of the computer: desktop computer Dell Inspiron 3847, processor i5 12 GB of RAM, 1 TB hard drive w / 770 GB free.

    I appreciate all help.

    A.T. - I finally thought to it.  After I had removed 3 of 4 songs and their respective video clips / photos in the problem project, I took a thorough review to the media with the rest one song left to see if there was something unique about.  As I mentioned earlier, I had all the different file types in the project problem included in the test project, and the test project had burned successfully to AVCHD.  After having scoured what was left of my files, I found a picture that I had used the effect of the "line of demarcation" (edit - effects - line drawing).  I decided to remove the effect to see what would happen.  Once I did, I was able to burn this new project to test a DVD AVCHD (a value of 1 only one song from the media).  I then made the same change to my complete project and then it worked.

    Very frustrating, but I'm very happy that I found the culprit.  I note that I used a couple of the photo / video effects projects successfully, but never this 'dividing line' a before.  I would warn anyone against using it now!

    In response to a recent question, I was not able to burn a folder when I had this problem either (4.7 GB).

    Thanks again for your help.  I really appreciate that people are available to help solve the problems of this kind.

    Happy holidays!

  • Problems with Weaver of dreams using the creative cloud

    Hello

    I downloaded the creative cloud in order to to use the Weaver of dreams (for my college

    class). I have no knowledge on this program, I watched the tutorials on

    the adobe and of course YouTube Web site. Everytime I open CC and attempt

    to open the app to Dream Weaver... it does work for me. I did something

    bad, do I need special software? I need all the help I can get with

    This thing, thank you very much!

    Jessica Reed

    If you try to open the DW of the CC desktop app, that will not work. The application of CC desktop is only for download, install and update the program (and a few extras).

    You will need access to your Applications (Mac) folder or in your Program Files (x 86) (PC) folder, and then to Adobe > Dreamweaver (your version) to find your actual application file. Create a shortcut or alias on your desktop to this file for future use.

  • Problem with update of Protection of the disk on Tecra A8 - 10F

    I have a problem that the Toshiba HDD Protection Utility does not work and I do not know why.
    {I tried this driver and I've not found for Tecra A8 PTA83E 10F but I found for Tecra M9 (PTM91) Windows Vista HDD Protection 2.0.1.7 Utility) updated the site {(ptm91)-hdd-protection-utility-2.0.1.7-windows-vista-free-download.html http://www.opendrivers.com/driver/239805/toshiba-tecra-m9}
    I installed it in my laptop but the problem is that this utility does not protect to shock the laptop, I put all settings by default, and do not protect not always.
    Perhaps because the driver for Toshiba Tecra M9?
    So please can someone give me this Toshiba HDD Protection Utility software?

    You can send me to my email: [email protected] or give me the site address :)

    Note: I've searched this site on this driver it and I can't find :(

    Hello

    In my opinion the disk utility HARD does not work on your Tecra A8 because the software was not designed for the A8 but for M9.

    The European driver Toshiba page does not provide the HDD Protection Utility for Vista.
    But I found one for the Tecra A9.
    http://EU.computers.Toshiba-Europe.com/cgi-bin/ToshibaCSG/download_drivers_bios.jsp?service=EU

    Look for the utility of the disk protection HARD Tecra A9 on the A8. Maybe it will work

  • Is there a problem with Adobe Reader DC using the command line to open a file?

    Hello

    I am a developer and we use Adobe Reader to view our PDF help files in our application.  For years, we used WinExec() to open Adobe Reader, by specifying the file to open on the command line and it has been working perfectly.  In other words, upward until our users began to load Adobe Acrobat Reader DC.  Despite this work very well when you type a command using CMD.exe, it simply does not help WinExec() from another application programmatically.  Also, I modified the code to try using CreateProcess() or ShellExecute() and these functions do not work either.

    It may have to do with the fact that there is a switch or a parameter now within the DC, but I don't know what it is, or why it happens.  If anyone can shed some light on this it would be much appreciated because it severely hampers our latest version of the software.

    Kind regards

    Leigh.

    A common cause is not to put quotes on the command line, so instead of

    "c:\program files...\acrord32.exe" "c:\documents and settings\...my file.pdf.

    You write

    "c:\program files...\acrord32.exe" c:\documents and settings\...my file.PDF

    This has always been bad, but older versions it would accept anyway. (It was a recent change but not in DC).

    I would recommend using ShellExecute instead of the command line, however. That simulates a double-click and executes everything the user has created for PDFs (perhaps Reader, Acrobat maybe, maybe something else).

  • Problem with update of table...

    Formum Dear members,

    Please do not kill me for this question, but after the execution of this query (DATE_OF_INVENTORY is a DATE field):

    UPDATE SET DATE_OF_INVENTORY = "; (and sending a commit afterwards), the area of the DATE_OF_INVENTORY of all the lines remains the same!

    So: How can I solve this?

    See you soon,.
    Johann

    Is there a trigger on the table that puts sysdate in this column?

    select trigger_name
    from user_triggers
    where table_name='A';
    

    Max
    http://oracleitalia.WordPress.com

  • Problems with running script by using the Get-Content cmdlet

    #Code to generate the report.

    ##-------------------------

    $vm = gc "vm.txt."

    and {foreach ($vm in Get-VM-location $DC) {}

    $parent is get-view $vm. ExtensionData.Parent

    $path = $vm. Name

    While ($parent. Parent) {}

    if($parent.) Name - only "vm") {}

    $path = $parent. Name + "\" + $path

    }

    $parent = get-view $parent.parent

    }

    # < #.

    Get-Datastore - VM $vm |

    Select @{N = 'Cluster'; E = {Get-Cluster - VM $vm |} {{Select - ExpandProperty name}}.

    @{N = "DataStore"; E={$_. Name}},

    @{N = 'The virtual computer name'; E = {$vm. Name}},

    @{N = 'Path of the VM'; E = {$path}},

    @{N = "ProvisionedStorage"; E = {Get-FriendlyUnit-value ($vm. ProvisionedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}.

    @{N = "UsedStorage"; E = {Get-FriendlyUnit-value ($vm. UsedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}

    }} $report | Export-Xlsx-path $ExcelFile - WorksheetName $DC - AppendWorksheet SheetPosition - end

    You could just that lead to the function of export-Xlsx

    Get-VM-name $vm |

    Select @{N = 'Cluster'; E = {Get-Cluster - VM $_______ |} {{Select - ExpandProperty name}}.

    @{N = "DataStore"; E = {Get-Datastore - VM $_______ |} {{Select - ExpandProperty name}}.

    @{N = 'The virtual computer name'; E={$_. Name}},

    @{N = 'Path of the VM'; E = {$path}},

    @{N = "ProvisionedStorage"; E = {Get-FriendlyUnit-value ($_.)} ProvisionedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}}.

    @{N = "UsedStorage"; E = {Get-FriendlyUnit-value ($_.)} UsedSpaceGB * 1 GB) | % {"{0, 7:f2} {1,2} ' f $_"} Value, $_. Unit}}} |

    Export-Xlsx-path $ExcelFile - WorksheetName $DC - AppendWorksheet SheetPosition - end

  • my computer recently crashed and when I tried to use photoshop, then I got the message: - message - problem with display driver, temporarily disabled the improvements. Does that mean, they will return when the problem is solved?

    My computer recently crashed. A fixed it but! When I then tried to use photoshop I got the message: - message - problem with display driver, temporarily disabled the improvements. Does that mean, they will return when the problem is solved?

    Update or restore your graphics driver.

  • I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not remove or add the program.

    I had a problem with slow, so I used "reset". The popup ran forever so I stopped it. Now I can not use, remove or add the program. How should I proceed?

    TIA,
    BWSwede

    Try to create a new profile.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but make sure not to copy corrupted files.

    What problems do you have that you want to reset Firefox?

    Firefox creates a new folder of old data of Firefox on the desktop?

    If reset you Firefox and a new profile is created and some of your data (bookmarks, passwords, cookies, form data) is automatically imported and your current profile will be moved on the desktop (old data of Firefox).

  • I've updated to 2015.2 in September and started having problems with freezing while working on the photos. I upgraded my memory from 4 GB to 8 GB and it has disappeared (in most cases); However, I always feel a lot of questions of export of JPEGs (gel) bu

    I've updated to 2015.2 in September and started having problems with freezing while working on the photos. I upgraded my memory from 4 GB to 8 GB and it has disappeared (in most cases); However, I always feel a lot of questions of export of JPEGs (gel) but not tif files? Very frustrating. Tried to install the new updates but my creative cloud is just a blank page?

    Hello

    I think you are referring to the white empty window of CC desktop application.

    Please refer to the threads below where this issue has been addressed:

    Creative cloud is empty window why?

    Cloud Desktop App is empty?

    New application Cloud Creative unusable: it is empty!

    Re: Empty opening creative cloud app

    Kind regards

    Sheena

  • When you try to update my laptop using the update of windows, the program blocking updates.

    When you try to update my laptop that runs windows 7 service pk 1 using windows update, the program blocks updates! My setting are correct I already checked. Not had a problem with updates until I had to do a full restore.

    I would be extremely grateful for any advice. Thank you

    Try this: difficulty of Microsoft Windows Update problems and troubleshooting problems with installing updates

Maybe you are looking for

  • Video stops playing after the transition

    I want to embed a video in a Keynote slide so that the video starts to play just after the slide in video. When I play the presentation and advance to the slide video, it plays for 1 second, then stops and the presentation falls back in design mode.

  • Update crashes at 8 min. To complete

    EL Capitan 10.11.5 update reboot hangs at 8 min. This is an iMac of 2013 end update since 10.11.4. It was at this point for about 20 minutes. I would like advice on how to proceed, ideally without making a Time Machine restore. Thank you John

  • DO NOT erase the output cache

    What happened to this option?I have a slow connection and need.It used to be a box to uncheck the box, but I can't find it anywhere... =)

  • install Windows 7 on the BACK

    I bought a new laptop with pre-installed in back. Should I partition my hard drive before installing windows 7?

  • IOS NXOS VPC PORT channel

    Hello I have a pair of Nexus 5 K in an area of the VPC and few 2960's as members of the VPC, with a port to the domain channel. Topology is: 5K 1 and 5 K 2 in the area of the VPC VPC 5 1 K and 5 K 2 to 2960 2960 a gi0/1 and gi0/2 in 1 port channel Gi