top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How can I do an UPDATE statement with JOIN in SQL?

+1 vote
313 views
How can I do an UPDATE statement with JOIN in SQL?
posted Jun 30, 2015 by Shivaranjini

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

update emp1
set emp1.emp1id = emp2.emp1id
from emp2 emp1
inner join sale emp2 on
emp1.id = emp2.emp2id

answer Jun 30, 2015 by Priyadharshini Kunjithapatham
Similar Questions
+1 vote

Forums

ID
Name
Description

Questions

ID
UserID
ForumID
Title
QuestionText
CreateDateTime

Replies

ID
UserID
QuestionID
ReplyText
CreateDateTime

users

UserID
UserName

I want to retrieve name of each forum, number of questions of each forum, number of replies of each forum, last post's UserName and date for each forum.

...