Solved

Update Query Required

Posted on 2011-02-24
9
272 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 250 total points
Comment Utility
UPDATE CLC
SET PUK.PUK1
FROM CLC INNER JOIN PUK ON CLC.IMSI_NO = PUK.IMSI_NO

Try this query
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
udpate clc
set pukk = (select puk1 from puk where puk.imsi_no =cls.imsi_no)
0
 
LVL 73

Expert Comment

by:sdstuber
Comment Utility
typo

update

not

udpate
0
 
LVL 40

Expert Comment

by:Sharath
Comment Utility
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 40

Expert Comment

by:Sharath
Comment Utility
didn't see sdstuber's post.
0
 
LVL 58

Assisted Solution

by:cyberkiwi
cyberkiwi earned 250 total points
Comment Utility
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 73

Expert Comment

by:sdstuber
Comment Utility
http:#34973172  should have been accepted since it was first

0
 
LVL 40

Expert Comment

by:Sharath
Comment Utility
I agree with sdstuber.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Via a live example, show how to take different types of Oracle backups using RMAN.

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now