Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-02-2009
Member
 
Join Date: Nov 2008
Posts: 85
Update with Inner Join SQL Server

hello

I have a small question regarding sql in oracle.
I have a question about Upadting with inner join in sql.

UPDATE MOJOJO
SET MOJOJO.CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList AS MOJOJO INNER JOIN
mstMakerModel ON MOJOJO.CarName = mstMakerModel.Model

It prompts that "CarMaker is not updatable".
Can somebody give me the proper syntax?
Please help me regarding this problem
Reply With Quote
  #2  
Old 25-02-2009
Member
 
Join Date: Apr 2008
Posts: 1,948
Re: Update with Inner Join SQL Server

UPDATE tblCarAuctionList
SET tblCarAuctionList.CarMaker = mstMakerModel.Maker
FROM tblCarAuctionList INNER JOIN
mstMakerModel ON tblCarAuctionList.CarName = mstMakerModel.Model

I think you can not use a table MOJOJO with update statement.
Reply With Quote
  #3  
Old 25-02-2009
Member
 
Join Date: May 2008
Posts: 2,008
Re: Update with Inner Join SQL Server

update t1
set t1.DESCRIPTION = t3.DESCRIPTION
from TBL1 t1 inner join TBL2 t2
on t1.UNIQUE_ID = t2.UNIQUE_ID_2
inner join TBL1 t3
on t2.UNIQUE_ID_1 = t3.UNIQUE_ID
Reply With Quote
  #4  
Old 25-02-2009
Member
 
Join Date: Apr 2008
Posts: 2,001
Re: Update with Inner Join SQL Server

UPDATE

Then join the tables that will meet the condition.

TABLEA AS A INNER JOIN TABLEB AS B ON A.F1=B.F1

Then state what's going to change.

SET A.X = 1, B.Y = 2

Then we add a WHERE clause.

WHERE A.Z =10

Tie it all together...

UPDATE TABLEA AS A INNER JOIN TABLEB AS B ON A.F1=B.F1
SET A.X = 1, B.Y = 2 WHERE A.Z =10
Reply With Quote
  #5  
Old 25-02-2009
Member
 
Join Date: May 2008
Posts: 2,293
Re: Update with Inner Join SQL Server

UPDATE MyTable
SET Column = NewValue
FROM MyTable
INNER JOIN OtherTable ON MyTable.Key = OtherTable.Key


In the above example, only columns in "MyTable" can be updated.
Reply With Quote
  #6  
Old 25-02-2009
Member
 
Join Date: Oct 2005
Posts: 2,389
Re: Update with Inner Join SQL Server

Update

[temp Call Data]

Set

Billingcli = Bill_numbermaps.[destcli]

From

Bill_numbermaps

Where

[temp Call Data].billingcli = Bill_numbermaps.sourcecli
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Update with Inner Join SQL Server"
Thread Thread Starter Forum Replies Last Post
Can't join XP pro to Server 2008- DNS Name does not exist Jof Davies Windows Server Help 1 02-04-2011 12:49 AM
RPC Server Unavailable when join domain LARRAJ Active Directory 4 13-07-2010 07:11 PM
Getting error while using UPDATE with join Bottlenecked Software Development 5 18-01-2010 01:53 PM
Update with Inner join on same table stracker.phil Software Development 1 16-12-2009 02:13 PM
Access Denied when trying to join a server to the domain Agilent Active Directory 2 14-12-2007 02:29 PM


All times are GMT +5.5. The time now is 07:26 PM.