Link to home
Start Free TrialLog in
Avatar of Aleks
AleksFlag for United States of America

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?
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try This......

Update A Set A.Email='xxxxxxxx@xmail.com'
From Atts A
Inner Join Users b
ON a.UserId = b.UserId
WHERE b.usertype = 'yyyy'
AND a.Xfer2Forms = '1"'
AND a.caseid = '1000'
Avatar of Aleks

ASKER

I apologize. I clicked on the wrong link. Yours would be the correct answer.