Hi....
i need the query to select the nth maximum value without using the "limit" in mysql 5
Thanks
S.Ashokkumar
Printable View
Hi....
i need the query to select the nth maximum value without using the "limit" in mysql 5
Thanks
S.Ashokkumar
try this following query where n-1 is you'r nthHighest value
SELECT max( a.id )
FROM test1 AS a
WHERE (n-1)<= (
SELECT count( DISTINCT (
b.id
) )
FROM test1 AS b
WHERE a.id < b.id )
:)