Welcome Guest, Not a member yet? Register   Sign In
find second highest value from a table
#1

[eluser]Bigil Michael[/eluser]
i want to find the second maximum value from a table

can any one help me??
urgent..
thanks in advance
#2

[eluser]Bigil Michael[/eluser]
query me used
Code:
SELECT * FROM candidate_details
WHERE
candidate_votes IN (SELECT MAX(candidate_votes) FROM candidate_details
WHERE
candidate_votes <> (SELECT MAX(candidate_votes) FROM candidate_details))
this code print correct result.

when i added 2 extra conditions like this
Quote:SELECT * FROM candidate_details
WHERE
candidate_votes IN (SELECT MAX(candidate_votes) FROM candidate_details
WHERE
candidate_votes <> (SELECT MAX(candidate_votes) FROM candidate_details))
AND constituency_id = '2' AND elect_year = '2011'
it prints 0 rows

can anyone help me????
thanks in advance.....
#3

[eluser]Bigil Michael[/eluser]
can anyone help me??????????




Theme © iAndrew 2016 - Forum software by © MyBB