This may seem like a dumb question, but here is what I am trying to do,
Lets say, I have a TABLE that has colums
A B C D
Now, I have added a 5th colum E
I want to populate E with D
I can't seem to get the insert command right,
Anyone ??Hello, please try this:
UPDATE myTable SET E=D;
Originally posted by ChrisWBates
This may seem like a dumb question, but here is what I am trying to do,
Lets say, I have a TABLE that has colums
A B C D
Now, I have added a 5th colum E
I want to populate E with D
I can't seem to get the insert command right,
Anyone ??|||Or more fully
UPDATE A SET E=D FROM myTable99 A
GOsql
Showing posts with label dumb. Show all posts
Showing posts with label dumb. Show all posts
Monday, March 26, 2012
Wednesday, March 7, 2012
Need a little bit of help
Need help
This may seem like a dumb question, but here is what I am trying to do,
Lets say, I have a TABLE that has colums
A B C D
Now, I have added a 5th colum E
I want to populate E with D
I can't seem to get the insert command right,
Anyone ??Hey,
update table t1
set e = (
select t2.d
from table t2
where t1.rowid = t2.rowid);
A more obvious query is to try
update table
set e = (select b from table)
This will not work with the returned error message :
ORA-01427: single-row subquery returns more than one row
This essentially means that for each single row you are trying to update the value e to the results of a query that returns > 1 row.
Cheers.|||Originally posted by r123456
Hey,
update table t1
set e = (
select t2.d
from table t2
where t1.rowid = t2.rowid);
On Oracle,
update t1 set e = d;
would work like a charm.
This may seem like a dumb question, but here is what I am trying to do,
Lets say, I have a TABLE that has colums
A B C D
Now, I have added a 5th colum E
I want to populate E with D
I can't seem to get the insert command right,
Anyone ??Hey,
update table t1
set e = (
select t2.d
from table t2
where t1.rowid = t2.rowid);
A more obvious query is to try
update table
set e = (select b from table)
This will not work with the returned error message :
ORA-01427: single-row subquery returns more than one row
This essentially means that for each single row you are trying to update the value e to the results of a query that returns > 1 row.
Cheers.|||Originally posted by r123456
Hey,
update table t1
set e = (
select t2.d
from table t2
where t1.rowid = t2.rowid);
On Oracle,
update t1 set e = d;
would work like a charm.
Subscribe to:
Posts (Atom)