Copy data from one column to other column (which is in a different table)

后端 未结 8 1539
小鲜肉
小鲜肉 2020-11-30 20:59

I want to copy data from one column to another column of other table. How can I do that?

I tried the following:

Update tblindiantime Set CountryName          


        
8条回答
  •  我在风中等你
    2020-11-30 21:51

    I think that all previous answers are correct, this below code is very valid specially if you have to update multiple rows at once, note: it's PL/SQL

    DECLARE
        CURSOR myCursor IS 
          Select contacts.BusinessCountry 
          From contacts c WHERE c.Key = t.Key;
        ---------------------------------------------------------------------
    BEGIN
        FOR resultValue IN myCursor LOOP
            Update tblindiantime t
            Set CountryName=resultValue.BusinessCountry 
            where t.key=resultValue.key;
        END LOOP;
    END;
    

    I wish this could help.

提交回复
热议问题