How can I update this table with values from another table?

Hello

I have a table 'governed '. I want to replace the values in the column "regies.agent" by the value of the column "regies_personnes.id."
As you can see the tables have a column of common values. IE regies.agent = regies_personnes.nom

Table 'governed ':
Insert into 'authorities' (AGENT) values ('Humberdot Alain");
Insert into 'authorities' (AGENT) values ("Danard Patrick");

Table 'regies_personnes ':
Insert into REGIES_PERSONNES (NAME, ID) values ("Humberdot Alain", 1);
Insert into REGIES_PERSONNES (NAME, ID) values ("Danard Patrick", 2);

Before having it
SQL > select agent of authorities;
Humberdot Alain
Patrick Danard

After the update, the result should be
SQL > select agent of authorities;
1
2

Thank you for your kind reply.

You can

update regies r set agent = (select id from regies_persones p where r.agent = p.nom)
  where exists (select id from regies_persones p where r.agent = p.nom)

Tags: Database

Similar Questions

  • How can I update an application if comes from another county store?

    I want to update an application at Bank of america americann, but I recently change my account to Mexico for a family account and when I try to update the Bank of America and Pandora Apps, it says that I need to change my store. I tried to do, but I don't know how.

    Is it possible to do it and how?

    You can change in a store when your Apple ID account indicates an address post office and has a credit card of the country you are trying to implement.

    Good luck

    GB

  • How can I update the rubrics with WebServices?

    How can I update the rubrics with WebServices?

    /Anyone/ has some success with this?

    It becomes important to our business objectives in order to solve the problems within the control elements.

    I can't enter the number of line by line in order to uniquely identify it. How can I get that number, so I can send it with xml "update"?

    A little nudge in the right direction would be much appreciated.

    Aaron.

    You must use a field on the form as the one on the line items, NOT the line number that appears in the journal of the line item. If I understand correctly, the LineItemIdentifier can be any field on the form, even the short description. It is best if you know you will use web services to update the line items, you add a (potentially hidden) field to the form and fill that with unique values when positions are created. If you are working with existing elements of line, then you must choose a field that will be usually unique within a single record and hope, you don't have a lot of duplicates.

  • How can I update this game if my system doesn't let me, I downloaded?

    How can I update this game if my system doesn't let me, I downloaded?

    original title: really want a response

    Hi Nicki Nichole,

    -What is the game in question?

    -You receive an error message during the update of the game?

    Your question does contain all the required information necessary for us to help you. Please include more information to continue troubleshooting as a result.

    Please see How to ask questions and provide the information required to help others.

  • I'd like to edit a PDF secure document did not change the text, or the layout at all I would do is highlight the text.  How can I do this?  With the help of Adobe Acrobat DC 15.9.20077.160923

    I'd like to edit a PDF secure document did not change the text, or the layout at all I would do is highlight the text.  How can I do this?  With the help of Adobe Acrobat DC 15.9.20077.160923

    You know the password? Otherwise, the security policy does not allow adding comments in the file, then there is nothing you can do about it.

  • I have adobe installed Muse v7.2 2012-2013, how can I update this program?

    I have adobe installed Muse v7.2 2012-2013, how can I update this program?

    If you have a valid subscription to Muse or CC; When you connect, it will work as a full version.

  • I had to change my Apple ID because of accusations of fraud but my iPhone 6s 9.2 still has the old Apple ID and will not accept old or new passwords. How can I update the iPhone with the new Apple ID 9.2 6s?

    I had to change my Apple ID due to fraudulent charges but my iPhone 6s 9.2 still has the old Apple ID and will not accept old or new passwords. How can I update the iPhone 6s 9.2 with the new Apple ID and password? I tried to perform a complete reset, but which requires the Apple ID and password that doesn't work not... pretty frustrated here.

    YYou have unlink the old iphone you as find my iphone the reset all devices on this subject from your account then plug it to your iTunes then restore a new one after that reset password that under the new phone then connect

  • Anti-shake error message - is more virtual tiles can be allocated--how can I resolve this - occurs with all images - has worked in the past

    How can I resolve this - he started today but I have not used for some time.

    Someone knows why - how resolve this problem isn't more virtual tiles can be allocated

    You ran out of disk space - free more disk space, or that you specify multiple disks in the scratch disk settings.

  • How can I remove this specific temporary file from my computer?

    original title: temp file

    How can I remove this file "tmp000064c7" C:\WINDOWS\Temp\Temporary Internet Files

    Hello

    You can also use DiskCleanUp:

    Start - All Programs - Accessories - System Tools - Disk Cleanup.

    I hope this helps.

  • How can I connect to my database externally from another pc on the network?

    Hi all

    I just install 12 c on my Oracle Linux box and I am able to connect locally to the database, as intended. Now, what would be the first step to connect to my external database from another computer on the network. By example, if the database server is 10.0.0.150 and I want to connect to 10.0.0.151 how can I make this happen? If necessary here are a few references:

    -bash-4, $ 2 cat listener.ora

    listener.ora # Network Configuration file: /ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora

    # Generated by Oracle configuration tools.

    LISTENER =

    (DESCRIPTION_LIST =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oranode1.dba.com) (PORT = 1521))

    (ADDRESS = (PROTOCOL = CIP)(KEY = EXTPROC1521))

    )

    )

    -bash-4, $ 2 cat tnsnames.ora

    tnsnames.ora # Network Configuration file: /ora01/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora

    # Generated by Oracle configuration tools.

    ANTHONYDB =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oranode1.dba.com) (PORT = 1521))

    (CONNECT_DATA =

    (SERVER = DEDICATED)

    (SERVICE_NAME = anthonydb)

    )

    )

    -bash-4, $ 2 cat/etc/hosts

    127.0.0.1 oranode1 oranode1.dba.com localhost4 localhost4.localdomain4

    : 1 localhost localhost.localdomain localhost6 localhost6.localdomain6

    10.0.0.150 oranode1.dba.com oranode1

    Let me know if you need any information. Currently, I am not able to connect to my database using the IP and port (10.0.0.150, 1521) of my 10.0.0.151 pc. Thank you all for your help in advance.

    Hello EdStevens,

    I tried to use the SID with SID = anthonydb and I got the same error message. I believe that we must resolve before listener troubleshoot us this error...  If we look at the file of the listener:

    [oracle@oranode1 admin] $ cat listener.ora

    listener.ora # Network Configuration file: /ora01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora

    # Generated by Oracle configuration tools.

    LISTENER =

    (DESCRIPTION_LIST =

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP)(HOST = oranode1.dba.com) (PORT = 1521))

    )

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP) (HOST = 10.0.0.150)(PORT = 1521))

    )

    )

    ADR_BASE_LISTENER = / ora01/app/oracle

    I have two entries, and I think that I should remove the last entry:

    (DESCRIPTION =

    (ADDRESS = (PROTOCOL = TCP) (HOST = 10.0.0.150)(PORT = 1521))

    )

    I created a backup of the file listener and I'm going to give it a shot.

  • How can I update the table table of contents for the sub condition?

    Hi guys,.

    I have a custom table that must be updated in a table source 'abc ';

    I have to update 8 fields of 'abc', based on five keys corresponding between custom and abc records

    Here is the syntax I have a suite please let me know the effective way to do this.

    I get the error message for the syntax below. I think that 'FROM' keyword must not be use GTA?

    update of custom table one

    Set a.field1 = b.field1, a.field2 = b.field2, a.field3 = b.field3

    ABC b

    where value = ' 05 "

    Hello

    Whenever you have a problem, please post a small example data (CREATE TABLE and only relevant columns, INSERT statements) of all the tables involved, so that people who want to help you can recreate the problem and test their ideas.

    Also post the exact results you want from this data, as well as an explanation of how you get these results from these data, with specific examples.

    If you ask yourself on a DML statement, such as UPDATE, then the CREATE TABLE and you post instructions INSERT must re - create the tables as they are to the DML, and the results will be the content of the or a modified tables when it's all over.

    Simplify the problem as much as possible.  For example, if your real problem involves 8 columns, try to post an issue affecting only 2 or 3 columns.

    Always say what version of Oracle you are using (for example, 11.2.0.2.0).

    See the FAQ forum: Re: 2. How can I ask a question on the forums?

    2766124 wrote:

    Hi guys,.

    I have a custom table

    What is a custom table?  How is it different from a regular table?

    that must be updated in a table source 'abc ';

    I have to update 8 fields of 'abc', based on five keys corresponding between custom and abc records

    Here is the syntax I have a suite please let me know the effective way to do this.

    I get the error message for the syntax below. I think that 'FROM' keyword must not be use GTA?

    update of custom table one

    Set a.field1 = b.field1, a.field2 = b.field2, a.field3 = b.field3

    ABC b

    where value = ' 05 "

    An example of the correct syntax for the use of a subquery in an UPDATE statement is:

    UPDATE one

    SET (Field1, Field2, Field2) =

    (SELECT field1, Field2, field3

    ABC

    WHERE value = ' 05 "

    );

    This is a correct syntax, but I don't know if this will do exactly what you want, because I don't know exactly what you want.

    FUSION is often easier and sometimes more effective than updated.

  • How can I update form field with data using "on Blur.


    Perhaps also very easy for all the experts out there that you but I'm trying to update a form field with data in another field in the form when they come out the first form field.

    Basically creating a "billing" and a form "shipping" I want to be updated automatically.

    Any help would be extremely Grateful.

    Thank you

    Steve

    He does!

    shipFirstNameText.value = this.value

    It worked

  • How can I update the training App values?

    I forgot to put an end to my session of training-how can I change/adapt the duration setting

    Hello

    It is not possible to change the length of the workout, but you can delete the workout.

    -On your iPhone, in health app (red heart on a white background), go to: health data > Fitness > workout sessions - swipe to the left on the drive, and then press DELETE / Trash.

  • How can I write this in sql? (an another headcracker challenging the report)

    Hi guys!

    I need to create / generate a report. I intend to do all of this with only pure SQL.
    Been cracking my head for days, but nothing helped.

    Hope you gurus here me straightened out.

    Here it goes. I have a table

    TABLE USAGE_REPORT
    ------------------------------------
    Date date of daily
    BalanceCF NUMBER - the sum of initial departure or (balancebf)
    Topup_amount NUMBER amount topup so far
    Usage1 NUMBER - duration of the use of $ on certain prod
    2 NUMBER - duration of the use of $ on certain prod
    BalanceBF NUMBER - BalanceCF + refill - usage1-2 (which is also the next date of BalanceCF)

    -----------------------------------------------

    Example1
    Please see this link
    http://img9.imageshack.us/img9/708/88149028.gif

    asumming that is my sql

    WITH dates in the FORM
    (
    SELECT trunc (sysdate) + level dmy
    DUAL CONNECT BY level < 366
    ),
    Charging as
    (
    As the SELECT trunc (purchase_date), sum (payment_amount)
    Purchase
    Trunc GROUP (purchase_date)
    ),
    Usage1 as
    (
    As the SELECT trunc (connect_date), sum (charged_amount)
    OF tab1
    WHERE prod_id = "xxx".
    GROUP BY trunc (connect_date)
    ),
    2 as
    (
    As the SELECT trunc (connect_date), sum (charged_amount)
    Of THE tab2
    WHERE prod_id = "yyy".
    GROUP BY trunc (connect_date)
    )
    SELECT * DATE D
    LEFT OUTER JOIN RELOAD T
    WE (D.DMY = T.DATED)
    LEFT OUTER JOIN USAGE1 U1
    WE (D.DMY = U1. DATE OF THE)
    LEFT OUTER JOIN U2 2
    WE (D.DMY = U2. (DATED);

    However

    T1) how can I start to 'launch' the 1st row
    BALANCECF so that i can do the math
    of

    BALANCECF + REFILL - USAGE1 - 2 = BALANCEBF

    Q2) how can I put the value of BALANCEBF in the 2nd line of BALANCECF to make more calculation?

    Q3) is that it has something to do and connect? parent-child relationship

    Q4) brief how to make it look like the photo attach above?

    Help, please!
    Best regards
    Noob

    I use 200 as initial balance_cf. did you not sample data, so code below is not tested:

    WITH dates as (
                   SELECT  TRUNC(SYSDATE) + level dmy,
                           200 balance_cf
                     FROM  DUAL
                     CONNECT BY level < 366
                  ),
         topUP as (
                   SELECT  trunc(purchase_date) dated,
                           sum(payment_amount) topup_amount
                     FROM  purchase
                     GROUP by trunc(purchase_date)
                  ),
        Usage1 as (
                   SELECT  trunc(connect_date) dated,
                           sum(charged_amount) usage_amount
                     FROM  tab1
                     WHERE prod_id = 'xxx'
                     GROUP BY trunc(connect_date)
                  ),
        Usage2 as (
                   SELECT  trunc(connect_date) dated,
                           sum(charged_amount) usage2_amount
                     FROM  tab2
                     WHERE prod_id = 'yyy'
                     GROUP BY trunc(connect_date)
                  )
    SELECT  dmy,
            balance_cf + sum(topup_amount - usage1_amount - usage2_amount) over order by dmy rows between unbounded preceding and 1 preceding) balance_cf
            topup_amount,
            usage1_amount,
            usage2_amount,
            balance_cf + sum(topup_amount - usage1_amount - usage2_amount) over order by dmy) balance_bf
      FROM  DATES D LEFT OUTER JOIN TOPUP T ON (D.DMY = T.DATED)
                    LEFT OUTER JOIN USAGE1 U1 ON (D.DMY = U1.DATED)
                    LEFT OUTER JOIN USAGE2 U2 ON (D.DMY = U2.DATED)
      ORDER BY dmy
    /
    

    SY.

  • The map database - how can I update the table

    Hello
    I develop a bpel using SOA 10.1.3.4 process. The process of bed from a table and writes to a table B. The process must then update table A for lines which it was moved to table B and look for new ones. I can't understand how to do this. Can you please tell me how this could be done.

    Thanks in advance for your help.
    HD

    It's a checkbox when configuraing the data source, it will be either XA or global transactions. I think that, by default, it uses global transactions, so you should be fine.

    see you soon
    James

Maybe you are looking for