Friends, I have these tables:
Contestant Table:
Winner
Peter
Group Table:
Id Name Score Union
1 Bryan 3 77
2 Mary 1 20
3 Peter 5 77
4 Joseph 2 25
5 John 6 77
I want to give additional score of 5 to Peter on Group Table. So, I came up with this query.
UPDATE Group
SET Score = Score+5
FROM Contestant, Group
WHERE Contestant.Winner = Group.Name
Now, I want also to give additional score of 5 to the same Union as Peter which is 77.
How can I integrate it as one query to my existing query?
//UPDATE 1
I have similar question as above but using 3 tables:
1. Company (table)
CONAME
COPOINTS
2. Group_Member (table)
CONAME
NAME
3. Member (table)
NAME
MPOINTS
I would like to have a correct query as below answer with the following condition:
Update Member
Set MPOINTS=MPOINTS+5
Where Company.CONAME=Group_Member.CONAME
And
Group_Member.NAME=Member.NAME
Can you please correct above query?
1 Answer