Hi
I need to add some code to the query below which also sets any records other than the winner who has the same DivElecID to 0. Any help greatly appreciated!
Cheers
Sila
I need to add some code to the query below which also sets any records other than the winner who has the same DivElecID to 0. Any help greatly appreciated!
Code:
update dbo.Candidate
set Winner = 1
where DivElecId = @DivElecID and
VotesReceived =
(Select max(a.VotesReceived) from dbo.Candidate a
where a.DivElecID = @DivElecID)
Cheers
Sila