Home » SQL & PL/SQL » SQL & PL/SQL » problem in copying
problem in copying [message #212082] Wed, 03 January 2007 13:33 Go to next message
durai
Messages: 38
Registered: December 2006
Member
i created two table
table1;
table2

table1 with two one column deptcode;with 5 rows
table2 with two one column empname;with 5 rows

now i added one column deptcode by altering table2;
i copied the column deptcode from table1 to deptcode of table2

but the no.of rows is 10 not 5 since the newly added row starts from 6 not from 1;
how to rectify this error
Re: problem in copying [message #212084 is a reply to message #212082] Wed, 03 January 2007 13:47 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
durai wrote on Wed, 03 January 2007 14:33

i copied the column deptcode from table1 to deptcode of table2



How did you "copy" the data. My thoughts are you meant to UPDATE the data ?
Re: problem in copying [message #212159 is a reply to message #212082] Thu, 04 January 2007 01:00 Go to previous messageGo to next message
vin_odks
Messages: 153
Registered: July 2006
Location: -
Senior Member
Quote:

but the no.of rows is 10 not 5 since the newly added row starts from 6 not from 1;


I think rows has been inserted and not updated..!!

Re: problem in copying [message #212270 is a reply to message #212082] Thu, 04 January 2007 08:03 Go to previous message
joy_division
Messages: 4963
Registered: February 2005
Location: East Coast USA
Senior Member
And if you were going to do the proper UPDATE statement, how do you think it is possible to update the DEPTCODE when there is no link between the DEPTCODE and the EMPNAME?
Previous Topic: Duplicate rows
Next Topic: Group by on a view
Goto Forum:
  


Current Time: Fri Dec 13 06:44:14 CST 2024