Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Update Query Required

Posted on 2011-02-24
9
Medium Priority
?
299 Views
Last Modified: 2012-05-11
I have two tables Table CLC(IMSI_NO,PUKK) and TABLE PUK(IMSI_NO , PUK1).

Need to update table CLC with PUk1 valueof Table PUK for values matching IMSI_NO in CLC and PUK
0
Comment
Question by:ratna1234
9 Comments
 
LVL 23

Accepted Solution

by:
Rajkumar Gs earned 1000 total points
ID: 34973141
UPDATE CLC
SET PUK.PUK1
FROM CLC INNER JOIN PUK ON CLC.IMSI_NO = PUK.IMSI_NO

Try this query
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34973172
udpate clc
set pukk = (select puk1 from puk where puk.imsi_no =cls.imsi_no)
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 34973190
typo

update

not

udpate
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 41

Expert Comment

by:Sharath
ID: 34973211
try this.
UPDATE CLC c 
   SET c.PUKK = (SELECT p.PUK1 
                   FROM PUK p 
                  WHERE c.IMSI_NO = p.IMSI_NO)

Open in new window

0
 
LVL 41

Expert Comment

by:Sharath
ID: 34973223
didn't see sdstuber's post.
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 1000 total points
ID: 34973275
If the other table is like a staging that which will not fully match the records in CLC, then you need a WHERE clause, otherwise you will be emptying all values in CLC.PUKK for records not matched in PUK.

UPDATE CLC c 
   SET c.PUKK = (SELECT p.PUK1 
                   FROM PUK p 
                  WHERE c.IMSI_NO = p.IMSI_NO)
WHERE c.IMSI_NO IN
(
SELECT IMSI_NOFROM PUK
)

Open in new window

0
 
LVL 74

Expert Comment

by:sdstuber
ID: 35511722
http:#34973172  should have been accepted since it was first

0
 
LVL 41

Expert Comment

by:Sharath
ID: 35514292
I agree with sdstuber.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question