-
its urgent plz provide the solution to this query
hi
here is the example, where i want to copy the data in the following format.
Table : s1
ecode ename sal
101 xxx 1000
109 yyy 2000
103 zzz 3000
Table : s2
ecode ename
101 xxx
109 yyy
103 zzz
i want to copy sal column with data of s1 table to s2 table.
-
Is this a college assignment?
Here is a hint, you have to update table S2 when S2.ecode = S1.ecode.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Buys a book or go to some class
Cheers!
OraKid.
-
plz send the complete query
there is no sal column in my table s2, then how can i use update command
iam learning oracle on my own, recently started. so iam getting doubts. nobody is for me to clear my doubts. i cant afford money to learn oracle. i came to know of ur web site thru my friend so is the reason iam posting all my doubts. if my doubts are irritating u, jst excuse me with ur big heart.
thankx in advance.
-
no column in table
there is no sal column in my table s2, then how can i use update command
where do you keep sal value if no column defined in table s2 ?
-
If your table S2 dones no contain SAL column and if you want than 1st you have to add that column in S2 table using
alter table s2 add (sal number());
after that you can update this column as PAVB suggested.
-
Your update will need to look like this:
UPDATE s2
SET s2.sal = (SELECT s1.sal
FROM s1
WHERE s2.ecode = s1.ecode)
-
Originally Posted by jay_l_a
Your update will need to look like this:
UPDATE s2
SET s2.sal = (SELECT s1.sal
FROM s1
WHERE s2.ecode = s1.ecode)
OP stated he wants to learn so IMHO this is the wrong approach... "give a man a fish, and you feed him for a day, teach him to fish, and you feed him for a lifetime".
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
-
Originally Posted by PAVB
OP stated he wants to learn so IMHO this is the wrong approach... "give a man a fish, and you feed him for a day, teach him to fish, and you feed him for a lifetime".
I agree to an extent, but nearly a week after originally posting 'its urgent plz provide the solution to this query', and not seeming any closer to a solution, I thought it time to counter some of the more sardonic replies the OP had received.
-
got you but, this wasn't a production issue therefore no "urgent plz..." applies.
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|