Results 1 to 6 of 6

Thread: Update with Inner Join SQL Server

  1. #1
    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

  2. #2
    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    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

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    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

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    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.

  6. #6
    Join Date
    Oct 2005
    Posts
    2,393

    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

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,641,212.83812 seconds with 17 queries