Blog Knowledge Base
Sign In Sign Up

How tp update from one Table to another based on a ID match in SQL

2014-09-23 12:48:00
UPDATE Sale
SET    AccountId = a.Id
FROM   Sale s
INNER JOIN Account a
  ON   a.LeadId = s.LeadId
UPDATE Sale
SET    AccountId = Account.Id
FROM   Account
WHERE  Sale.LeadId = Account.LeadId
SQL
Tags Dates
ASP.NET 4.5 ASP.NET Core ASP.NET Core 2.x C# C# Snippet Convention CSS CSS Tricks Design Patterns Domain-Driven Design Dynamic C# Entity Framework Entity Framework 6 Entity Framework Core Entity Framework Core 2 Font End Exmples HTML JavaScript linq Microservices MS Excel NUnit React SQL SQL Admin SQL Date SQL JOINS SQL Local SQL Questions SQL Snippet SQL Stored Procedure SQL sys SQL Template SQL Useful Functions TDD WPF

Copyright © 2023 delaney. All rights reserved.

Contact
Required
Required
Required
Required
/ 750
Required

Email Change Confirmation

An email will be sent to your new email address.
Please open it and click the link to validate your new address.

Please note your new email address will not be valid until you have done so.

Password Changed

Your password has been changed.