Solved

Update Query Required

Posted on 2011-02-24
9
277 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
ID: 34973141
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
ID: 34973172
udpate clc
set pukk = (select puk1 from puk where puk.imsi_no =cls.imsi_no)
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 34973190
typo

update

not

udpate
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
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 40

Expert Comment

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

Assisted Solution

by:cyberkiwi
cyberkiwi earned 250 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 73

Expert Comment

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

0
 
LVL 40

Expert Comment

by:Sharath
ID: 35514292
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.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PAYER_ID has both atributes 4 37
su - oracle could not open session 6 74
SQL query question 8 75
Distinct values from all columns in a table?? PL SQL 4 37
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
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…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

770 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