Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update Inner JOin Problem

Status
Not open for further replies.

Glowworm27

Programmer
May 30, 2003
587
US
I want to update a table with data from another table.

I am a familuar with SQL version where I can use an Inner Join to get the matching rows I wish to update but how do I get this to work in oracle?

here is the query that I want to use
Code:
Update Location_Master LM1
Set LM1.Company = i.Col003
, LM1.Store_Description = i.Col006
From Location_Master LM2
Inner Join 2007423_133618_LocationMaster i On LM2.StoreNbr = i.Col001;

thaanks

George Oakes
Check out this awsome .Net Resource!
 
Glowworm,

This is how I would code your solution:
Code:
Update Location_Master LM1
Set (Company,Store_Description) =
     SELECT i.Col003,i.Col006
       From 2007423_133618_LocationMaster LM3
      where LM1.StoreNbr = LM3.StoreNbr)
where exists 
    (SELECT null
       from 2007423_133618_LocationMaster LM3
      where LM1.StoreNbr = LM3.StoreNbr);
Let us know how this works for you.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top