Update with no link between the tables

Hi all
Let us, considering what follows in 11g:
SQL> create table t1 (col1 number , col2 number);
 
Table created
 
SQL> create table t2 (col1 number, col2 number);
 
Table created
 
SQL> insert into t1 values(1,2);
 
1 row inserted
 
SQL> insert into t1 values(2,3);
 
1 row inserted
 
SQL> insert into t1 values(3,4);
 
1 row inserted
 
SQL> insert into t2 values(5,6);
 
1 row inserted
 
SQL> insert into t2 values(7,8);
 
1 row inserted
 
SQL> insert into t2 values(9,10);
 
1 row inserted
 
SQL> commit;
 
Commit complete
How can I update the table T2 col1 - column - with values of column in table T1 - col2? No order no required - just the values :)
Maybe it's simple, but I can't get there...

Thanks in advance,
Alexander.
select *
from t1;

COL1 COL2
---- ----
   1    2
   2    3
   3    4 

select *
from t2;

COL1 COL2
---- ----
   5    6
   7    8
   9   10 

merge into t2
using (
 select *
 from ( select rowid rid,row_number() over(order by null) rn1
          from t2
        ) a,
       (
         select t1.*,row_number() over(order by null) rn2
         from t1
       ) b
 where a.rn1 = b.rn2
      )   x
on (t2.rowid = x.rid)
when matched then update set t2.col1 = x.col2;

3 rows merged.

select *
from t2;

COL1 COL2
---- ----
   2    6
   3    8
   4   10 

Published by: JAC on November 5, 2012 18:36
Amended or the requirement

Tags: Database

Similar Questions

  • I got a prob while creating a link/link between two tables in a jdeveloper11g

    Hi guys...

    I got a prob while creating a link/link between two tables in a jdeveloper11g, help me.

    I use two table employee, Department.

    Unfortunately there is no primary key and foreign key in these tables.now i updated on those of table structure.

    I want to create a form like it should be a link between the Department data, i.e. data and employee while the Department is changed then only present corresponding employees in this block...

    Table structure as follows

    Employee:

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

    employe_id,

    name,

    Department,

    GR,

    Date of birth

    Department of justice

    Department:

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

    department_id,

    department_name;

    Note: in the employee department table is the same as in the department table department_id...

    So, you want to build master / detail between Department & sub_departments?

    In the same way, create a new, yet another link between departments & sub_departments, so that the connection is:

    Department.Department_Id = sub_departments.department_id

  • Any way to link between the projects merged on HR server?

    Hello. Me once again.

    Is it possible to maintain links between the pages of different projects merged to the HR server?

    Clarify, consider the gross example of presentation of the projects merged in HR server. Say that the authors of the projects have an agreement that project names (for example, "output of the second project") and the first ('welcome') subject will have static names. Is there a way to, for example to create a link in the Welcome th pagee first output of the project , which opens the page home of the second output of the project? If so, please suggest the correct syntax.

    Note: I found that do a right click on a navigation item, copy the link, then paste the link in the address line of the browser, then the project that contains the link opens outside the context of the environment have been merged. Only clean the project navigation is displayed.

    Thanks in advance.

    -Kurt

    RHServer_Merge_mockup.png

    Answered own question with another experience.

    As I said in the original post:

    > Note: I found that do a right click on a navigation item, copy the link, then paste the link in the address line of the browser, then the project that contains the link opens outside the context of the environment have been merged. Only clean the project navigation is displayed.

    ... If you take this copied link and use it as a the hyperlink address, instead of in the address line of the browser and navigation to him directly, just copy the link DOES not work. For example, the hyperlink works for the original query:

    http://192.168.231.128:8080/RoboHelp/Robo/Server/General/projects/second%20Project%20outpu t/also

  • the link between the letters.  That is to say. crochet and C by a

    I want the link between the letters.  That is to say. crochet and C by one, as if the A is suspended from the crossbar to the a.  I remember in the past.  It was with the (pen tool?) to lift the piece that overlap a letter (above), thus revealing the other letter that was below.  It does not work now.  I don't know if I've done AI or PS anyone know how to do this, or I was dreaming?

    Do you mean like this:

    Use the transparency Panel and make a mask on the part of the letter that you want to hide. In this case, I did the copy of the c., glued in place and changed paths. Then I deleted everything except the part I needed and with it and has selected, make a mask.

  • white space between the tables

    Hello

    I do an annual report and there is a lot of financial tables. I have 60 paintings and I need to align the tables vertically so that the white space between each table is exactly the same. So far I did it manually. I'm sure there is a better way to do it but I just have not found the way yet. My first thought was to do a 'parent' table with X rows and one column. So I put my child tables in the parent table and use a "row of the spacer" exactly the mm X I tried this but it really complicates things

    Then I tried 'space after' in the properties of the table, but I can't understand what this attribute.

    In other words, I would like that the vertical space between table 1 and table 2 is always exactly 5 mm of the force. How is that possible?

    I would like some inputs/best practices.

    / Best regards

    Thomas Lund

    Your table is placed in a paragraph.  Create a paragraph style that contains that space after that you want between the tables, and then apply that style to all paragraphs that contain tables.  That should give you exactly the spacing between your tables in the flow of the text.

    This will not work unless you are running off the paintings together in a story (which I recommend).

  • cfform/cfinclude causing the unsightly gap between the tables

    I'm working through a problem that I have a cfform/cfinclude statement causing a gap between menu items. I inherited to support this site and I didn't design it. It was designed using tables to create the layout and navigation that are implemented using cfincludes menus. Here is an example of the problem (code included below). There is a gap between the horizontal menu that starts by contacting us and left navigation menu which starts by find a State Park.

    When I move the cfform tags while they are inside the table tags, the gap goes away, but then my user that modifies the content through Contribute, has a problem with text being pushed far down and to the right, making it difficult for her to change. I tried to move the tags in a variety of ways, and each of them is causing the gap or push the text down to the right in the design editor.

    We do not have the resources to put me in time that is needed to actually solve this problem by getting rid of the layout of the table and moving the CSS layout, because this problem appears on more than a hundred pages (which many have a fairly consistent coding for me just do a successful search and replace). I would fix - rather - straight, but I can't.

    I had reason to conclude that there is no way to stop the cfform tag to put a space between the table tags?

    Quote:
    Posted by: newsgroup user
    Just add style = "margin: 0;" to the

    Tag, or in your css file add
    form {margin: 0 ;}}

    Weird. I tried both of those in front, but apparently I didn't was not put it in the right places because put the style in the tag worked a treat. Thank you very much.

  • break the link between the pix and sound

    Ugh I still don't know how to break the link between the pix and the sound in the timeline then of

    the sound and image are together. I know it of easy but have not yet found the way.

    Thank you everyone.

    Right-click on the clip and click 'Remove link' If you just want do temporarily, ALT click on the clip.

  • How can I remove a space between the tables?

    In dreamweaver, there seems to be no space, and the page is fine, but when I go into

    Internet explore there is a gap between the tables.  I want my image to be

    at the bottom of my table, based on the footer.

    I tried for hours to solve this problem and I can not, there is always a space between my image of HR helpline and my footer.

    I put all the borders and spacing between cells to 0, but nothing seems to work.
    I have not yet my web site online, so can not tell you what the URL, but when I view source in internet Explorer this is the code:
    < td bgcolor="#FFFFFF"> </td>

    <td width="430" height="200" align="center" valign="bottom" bgcolor="#FFFFFF"> <!-InstanceBeginEditable name = "EditRegion2"->
    < p > <img src=".. "" / frustrated helpline.jpg ' alt="HR helpline" width="331" height="282" border="0" longdesc="" "http://HR telephone helpline" / ><! - InstanceEndEditable - >< /td>
    </ tr >
    </ table >

    < table width="900" border="0" align="center" cellpadding="0" cellspacing='0'>
    < tr bgcolor="#FFFFFF">
    < td valign="top"> <img src="images/Core HR foot 900.jpg Web" width="900" height="81" alt="london surrey berkshire kingston" longdesc="""http://footer"" " / > < /td>
    </ tr >

    </ table >

    Thanks if anyone can help, I'm really new to this.
    Helen

    Add the CSS rule to remove the border from the image

    IMG
    {border-style: none;}
    }

  • text with link in the table

    Hello

    I built a page with a table, in each cell of the table is an image, a link and a text:

    < td > < img src = "images/reddot.gif" width = "15" height = "15" / > < a href = "contrib1.html" / > < table > contributor "

    the text font and size seem ok, but when I added the link it has changed color and become stressed.

    I think it has to do with the fact there is a link, but I don't want it to happen (stamp feet scream, make a cup of tea) how do the text stay plain and black and change when you click light gray?

    any help appreciated here is the bit of css are:

    table {}

    overflow: hidden;

    padding: 1px;

    do-color: #000;

    margin-left: auto;

    margin-right: auto;

    width: 90%;

    are-size: 30px;

    text-align: center;

    }

    Andrew

    You need style your links with CSS.  Add this to your external style sheet, and change colors according to your needs:

    a {text-decoration:none}
    a:link {color: #FF0000;}   /* unvisited link */
    a:visited {color: #00FF00} /* visited link */
    a:hover {color: #FF00FF}   /* mouse over link */
    a:active {color: #0000FF}  /* selected link */
    

    More on CSS Pseudo-classes:

    http://www.w3schools.com/CSS/css_pseudo_classes.asp

    Nancy O.
    ALT-Web Design & Publishing
    Web | Graphics | Print | Media specialists
    www.Alt-Web.com/
    www.Twitter.com/ALTWEB

  • Impossible to make the link between the consistent readings with the number of physical block reads

    Hello

    The issue is that we have seen consistent readings are more than the total buffers necessary to give back the results.
    I emptied the buffer_cache before you execute the query and also questioned the V$ BH to know the details of the buffer for these objects... After the flush before you trigger the request that we do not have buffers about these tables. Which is expected.
    We are doing sequential reads of DB file with the plan and will result in a single block, read at a time.
    Please take a close look at "TABLE ACCESS BY INDEX ROWID CMPGN_DIM (cr = pr 45379 = 22949 pw = time 0 = 52434931 US)" line in the plan source line below...
    Here we have only 22949 data buffers 22949 means reading physical but we are witnessing gets 45379 coherent.

    Note: We have the CMPGN_DIM and AD_GRP tables in the tablespace size 4 M block and we have only the default db_cache_size. My database block size is 8192.

    Can you please help me understand how the 22949 sequential reads the result in 45379 coherent takes.

    Even the V$ BH query buffer details matches with physical reads.


    line source of 10043 trace query plan:

    SORT ORDER BY 27 (cr = 92355 pr 47396 pw = time = 0 = 359030364 en)
    27 WINDOW SORT (cr = 92355 pr 47396 pw = time = 0 = 359030088 en)
    NESTED LOOPS EXTRA-ATMOSPHERIQUE 27 (cr = 92355 pr 47396 pw = time = 0 = 359094569 en)
    NESTED LOOPS EXTRA-ATMOSPHERIQUE 27 (cr = 92276 pr 47395 pw = time = 0 = 359041825 en)
    VIEW 27 (cr = 92197 pr 47393 pw = time = 0 = 358984314 en)
    UNION-ALL 27 (cr = 92197 pr 47393 pw = time = 0 = 358984120 en)
    HASH GROUP BY 26 (cr = 92197 pr 47393 pw = time = 0 = 358983665 en)
    VIEW 9400 (cr = 92197 pr 47393 pw = time = 0 = 359094286 en)
    9400 COUNT (cr = 92197 pr 47393 pw = time = 0 = 359056676 en)
    VIEW 9400 (cr = 92197 pr 47393 pw = time = 0 = 359009672 en)
    9400 SORT ORDER BY (cr = 92197 pr 47393 pw = time = 0 = 358972063 en)
    9400 HASH JOIN EXTERNAL (cr = 92197 pr 47393 pw = time = 0 = 358954170 en)
    VIEW 9400 (cr = 92191 pr 47387 pw = time = 0 = 349796124 en)
    JOIN by HASH 9400 (cr = 92191 pr 47387 pw = time = 0 = 349758517 en)
    94 the TABLE ACCESS BY INDEX ROWID CMPGN_DIM (cr = pr 45379 = 22949 pw = time 0 = 52434931 US)
    50700 IDX_CMPGN_DIM_UK1 INDEX RANGE SCAN (cr = 351 pr = 349 pw = time 0 = 1915239 US)(object id 55617)
    TABLE ACCESS BY INDEX ROWID AD_GRP 60335 (cr = 46812 pr 24438 pw = time = 0 = 208234661 en)
    60335 INDEX RANGE SCAN IDX_AD_GRP2 (cr = 613 pr = 611 pw = time 0 = 13350221 US)(object id 10072801)
    VIEW 7 (cr = 6 pr = 6 pw = time 0 = 72933 en)
    7 HASH GROUP BY (cr = 6 pr = pw 6 = 0, time = 72898 US)
    162 PARTITION SINGLE PARTITION RANGE: 4 4 (cr = 6 pr = 6 pw = time 0 = 45363 en)
    162 PARTITION PARTITION UNIQUE HASH: 676 676 (cr = 6 pr = pw 6 = 0, time = 44690 US)
    162 INDEX RANGE SCAN PK_AD_GRP_DTL_FACT PARTITION: 3748 3748 (cr = 6 pr = pw 6 = 0, time = 44031 US) (object id 8347241)
    1 DOUBLE QUICK (cr = 0 pr = 0 pw = time 0 = US 9)
    25 TABLE ACCESS BY INDEX ROWID AD_GRP (cr = 79 pr = 2 pw = time 0 = 29817 US)

    user622572 wrote:
    Hi Charles,
    In this test of problem we have not any activity on my tables other than my session. If we do not have all cancel must be applied to the brand CR.

    * "So, which means the above?" *-->, that means the number of times where the blocks was visited is counted as CR not the number of buffers required to respond to a request. "

    * "" Why a plan of execution would change the number of makes more sense? "*--> changes in the method of access to the path and join required a different number of times the same buffer necessary visit." It means NL require more number of same buffer visits to T2, T1 and INT_T1_C2 as the hash join.

    * "' Why not flush the buffer cache would result in the PR drop statistics to 0, but does not change the statistics CR?" *--> each result buffer in physics RAS reads for objects from there which is why it cannot be zero in the first 4 tests where as test5 require PI (we don't rinse prior to that in your test case). " CR cannot be changed with buffer flush. Required CR same amount of pads and tampons visits regardless of buffer flush.

    It seems that we can say that "CR numbers include the number of times the block was visited in a query instead of just the number of buffers required". ""

    user622572,

    You deserve a lot of credit for having read and understood what I posted to correctly answer the questions I asked at the bottom of results and for your ability to answer your original question.

    Charles Hooper
    IT Manager/Oracle DBA
    K & M-making Machine, Inc.

  • Dynamic link between the first CC and After Effects CS6 is not working :(

    Screen Shot 2013-08-15 at 8.32.10 PM.png

    I'm editing with RED r3d files. I've just updated to CC, but he does not want the dynamic link with After Effects CS6

    Hello

    Sorry, but Dynamic Link works only between the same version of the product.

    Best,

    Peter Garaway

    Adobe

    Premiere Pro

  • Synchronization of data between the tables of towing

    HII
    I have two database 1 and both of the databases of database 2 have citizen of table (citizen_ssn, citizen_name) with the same structure
    Ok

    and I create the link of database database 1 into database 2 (link name: link1)
    and I have another link for 2 to 1 of the databases database (link name: Link2)
    I want to synchronize data between two tables
    in other words, I want to when new record adds database1 go base2 and check if this folder exists (using citizen_ssn) or not, if it exists then add the record only in database1
    otherwise add record base1 and base2.

    and if there is record inserted into database 2, I'll go to database1 and check if it exists, it exists to add recording base2, if not add it in base1 and base2

    can I do this in real time or not.
    Thank you...

    I don't see how you have an infinite loop. If you insert a row into database1, the trigger will fire and verify the existence of the line of base2. If the line exists in base2, nothing happens. If the line does not exist, then a line will be inserted in base2, after what the relaxation in base2 fires that will check the existence of the line in database1 and, since it is, won't do anything.

    What Miss me?

    HTH
    Srini

  • How to establish the relationship between the tables contact and Global (entity) in Oracle Service Cloud to preconfigure data

    Hello

    We strive to integrate the OPA attributes to the Cloud Service Oracle tables to store session data for the customer portal users.

    We tried mapping the attributes of the OPA with relevant tables of cloud Service Oracle? Is there any installation of additional data to create to retrieve the session data for the particular user / contact?

    We managed to save tha data in arrays of cloud Service for users of ananymous and also well regarding customers portal users but to preconfigure data do we need to do any additional configuration / mapping to the contact table?

    Please help on the establishment of the relationship between the contact and Global (new table created in cloud Service) tables.

    Thank you

    Vivek

    Hi Vivek,

    To load data from the Contact in the the OPA policy template, you must configure the widget of the OPA. For instructions, see the following articles:

    - Incorporate an interview that uses data portals in Oracle Service Cloud Customer Portal

    - Deploy and configure the sample OPA widget

    - Insert the widget to sample in a customer portal page

    Obviously, you need to do the mapping in OPM as well, but even if the mapping is correct, you will not be able to load the Contact data unless the widget of the OPA is implemented.

    See you soon,.

    Jasmine

  • Dynamic link between the first problem and speedgrade CC 2014

    Hello Eveyrne!

    I have trouble to back and forth from first to speedgrade. For example, I can send the images to speedgrade, my image quality and come back to the to first with my settings in place. However, how to get back in the category of speed (of creation) if I need to add a finishing touch? It seems that the only options are just all send in grade speed once again, but there my previous settings in place I start from scratch... I hope I made that clear.

    Thank you

    Mike

    Moment of clarity: is the link Direct from PrPro/Sg and dynamic links to the PrPro/Ae. They are not even close to the same process of sub hood, and due to the proximity of the nomenclature selected to more trouble they should have created. Adobe LIKES having both be a 'DL'... and 'their' it is very clear. Given that we users like usually jump using long verbiage... including the two acronyms it is STUUPID on someone the part but oh, that's just my personal opinion spouting off here... and Yes, I spoke with members of the staff of Adobe in the conversations of real (like many others) life and 'they' know my thoughts. So I'm not dissing anyone here that I haven't talked... and laughed... on this subject in person.

    Then... you can take your project in Sg, grade it, click on the back of PrPro icon & return to work in PrPro, but when "send you to Sg' to return to the Sg of the prior work does not appear?

    If this is the case, it's weird and NOT expected behavior. I go come & constantly back... sometimes within PrPro, sometimes actually just starting Sg and choose a project of PrPro I know I need to change some more. It is recorded above PrPro, should it show me latest project settings from there.

    To be clear, the process requires that whenever you go forward and backward, to each stage... the project is saved & so updated. If say you let open Sg, even more on a project work on PrPro but does not save, then just raise Sg again... There will be a project file updated yet so that it works on. So... work in PrPro, "send to...". ", the project is saved, & you leave. Work in the Official Journal, either use the 'save' icon or click the 'Return to the PrPro' which requires a backup operation... then PrPro, use it "send to" new requiring a save operation.

    Neil

  • OIM11g - remove the link between the user and the account

    We have configured a rule wrong Recon for a resource and then run the task of reconciliation on a limited number of users; the result is that these users are connected to the target system wrong accounts.
    Now, we have configured the right Recon rule, but we do not know how to clean/delete the 'link' created for users to reconcile, we want to run a new reconciliation from scratch.
    Is this possible?
    Can anyone provide a detailed guide of the how-to (step-by-step)?

    Thank you
    Gabriele

    Published by: user1175296 on June 29, 2012 07:50

    Published by: user1175296 on June 29, 2012 08:05

    user1175296 wrote:
    Hi madhatter.
    I agree with you and I will use the OIMDAO, but for more information and to make a test in the DEV env, can indicate you the name of the 11 tables that you mentioned?

    Sorry for a slight misunderstanding, I feel the ProcessInstance (ORC) table when talking about about 11 tables in detail. These 11 paintings is as follows:

    OLIVIER ObjectInstance
    BOA Organization2ObjectInstance2ProcessInstance
    Ouedraogo ResourceAccount lastAttestedResourceAccounts
    ORC ProcessInstance childProcessInstances
    OSI TaskInformation
    OTI TaskDetailMisc
    NCE ReconciliationManager
    REQ req. reqs
    RECON_ACCOUNT_MATCH ReconAccountMatch
    RECON_EVENTS ReconEvent
    RECON_CHILD_MATCH ReconChildMatch

    As for the ResourceAccount table (Ouedraogo), here's what I found in the file xell.sql of the distribution of the UCR:

    ALTER table OUD
    Add constraint FK_OUD_OIU foreign (OIU_KEY) keys
    references Ouedraogo (OIU_KEY)
    /
    ALTER table OUD
    Add constraint FK_OUD_OUD_PARENT_OIU foreign (OUD_PARENT_OIU_KEY) keys
    references Ouedraogo (OIU_KEY)
    /
    ALTER table RIU
    Add constraint FK_RIU_OIU foreign (OIU_KEY) keys
    references Ouedraogo (OIU_KEY)
    /

    CREATE TABLE ENT_ASSIGN)
    ENT_ASSIGN_KEY NUMBER (19) NOT NULL,
    OIU_KEY NUMBER (19).
    UNIQUE CONSTRAINT UK_ENT_ASSIGN (USR_KEY, ENT_LIST_KEY, OIU_KEY),
    CONSTRAINT ENT_ASSIGN_OIU_FK3 FOREIGN KEY (OIU_KEY) REFERENCES OUEDRAOGO (OIU_KEY)

    CREATE TABLE ENT_ASSIGN_DELTA)
    ENT_ASSIGN_DELTA_KEY NUMBER (19) NOT NULL,
    OIU_KEY NUMBER (19).
    CONSTRAINT ENT_ASSIGN_DEL_OIU_FK1 FOREIGN KEY (OIU_KEY) REFERENCES OUEDRAOGO (OIU_KEY)

    CREATE TABLE ENT_ASSIGN_HIST)
    ENT_ASSIGN_HIST_KEY NUMBER (19) NOT NULL,
    OIU_KEY NUMBER (19).

    As you can see, there are at least 6 references Ouedraogo in 5 tables.

    I myself prefer to delete process Instances (not ResourceAccount), eliminating all of the artifacts supply resource account, including the data of the form (records in the tables of UD_xxx).

Maybe you are looking for

  • default screen of Windows 8

    I have a desktop PC with Windows 8.  When I us as an application of Windows 7, google chrome and default permission in Windows 7 screen.  I want her to be default to the screen of Windows 8.

  • Noises grinding hard when I record

    I tried my rocket to record myself when I practice (classical) music. Sometimes I have a shrill noise every now and then when I play back and other times it's beautiful. The noise lasts a fraction of a second, but he is very strong. This isn't a mech

  • AWUS036H does weird things when it is connected to a USB port.

    I have a network card 802.11 g Alfa AWUS036H, the chipset Realtek RTL8187L.  I installed the latest drivers.  When I plug this device into my USB port, the computer recognizes the device without problem.  However, the system starts turn off and turn

  • Dell PowerVault MD3600i validation error - unable to update firmware - Data:

    Hello I have the following problem when trying to upgrade the firmware version of 07.84.44.60 to 07.84.47.60 on my Dell PowerVault MD3600i. Assistant firmware upgrade RAID controller module reports the following error Data validation error: the stora

  • The calendar entries to duplicate software on 2-way sync blackBerry

    Greta BB10 has now 2-way synchronization, but... How to stop duplicate entries appear? It serves to miss them, or at least ask what had preference but all that's happened is that they have been copied across and duplicated. Rather than delete and the