Welcome Guest, Not a member yet? Register   Sign In
find second highest value from a table
#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.....


Messages In This Thread
find second highest value from a table - by El Forum - 04-19-2011, 04:49 AM
find second highest value from a table - by El Forum - 04-19-2011, 05:08 AM
find second highest value from a table - by El Forum - 04-19-2011, 05:14 AM



Theme © iAndrew 2016 - Forum software by © MyBB