Solved

Update Query Required

Posted on 2011-02-24
9
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 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
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
Suggested Courses

623 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