Aleks
asked on
SQL - UPDATE using Inner Join
I'm trying to run the following command from my database:
UPDATE Atts a
INNER JOIN Users b ON a.UserId = b.UserId
SET Email = "xxxxxxxx@xmail.com"
WHERE b.usertype = "yyyy" AND a.Xfer2Forms = "1" AND a.caseid = "1000"
However, I get the following error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'a'.
Is this a syntax issue?
UPDATE Atts a
INNER JOIN Users b ON a.UserId = b.UserId
SET Email = "xxxxxxxx@xmail.com"
WHERE b.usertype = "yyyy" AND a.Xfer2Forms = "1" AND a.caseid = "1000"
However, I get the following error:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'a'.
Is this a syntax issue?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I apologize. I clicked on the wrong link. Yours would be the correct answer.
Update A Set A.Email='xxxxxxxx@xmail.co
From Atts A
Inner Join Users b
ON a.UserId = b.UserId
WHERE b.usertype = 'yyyy'
AND a.Xfer2Forms = '1"'
AND a.caseid = '1000'