Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
SELECT MAX(VotesReceived) AS Expr1
FROM dbo.Candidate a
WHERE (DivElecID = @DivElecID)
and VotesReceived < (SELECT MAX(VotesReceived)
FROM dbo.Candidate where DivElecID = @DivElecID))
select max(VotesReceived) As blah
from Candidate
where DivElecID = @DivElecID
and VotesReceived <
( select max(VotesReceived)
from Candidate
where DivElecID = @DivElecID
)
select min(blah) as blah
from
( select top 2 VotesReceived As blah
from Candidate
where DivElecID = @DivElecID
order by VotesReceived desc
) X
declare @blah int
select top 2 @blah=VotesReceived
from Candidate
where DivElecID = @DivElecID
order by VotesReceived desc
SELECT MAX(VotesReceived) AS Expr1
FROM dbo.Candidate a
WHERE (DivElecID = @DivElecID)
and VotesReceived not in (
SELECT MAX(VotesReceived) AS Expr1
FROM dbo.Candidate a
WHERE (DivElecID = @DivElecID)
)
I now need to select the second largest value within the id