Hi,

Finally I found the query which gives me the desired result....I have a table PARTNER with 3 columns ID,NAME & COUNTRY_NAME.....aim was to find top 3 countries having highest no. of partners......this is the query I have tried.....(and it worked too !!!!)

==============================================
SELECT distinct country_name, count(name) as cnt
FROM tblpartner
GROUP BY country_name
HAVING count(name) >= ALL
(SELECT distinct count(name)
FROM tblpartner
GROUP BY country_name
HAVING count(name) < ALL
(SELECT distinct count(name)
FROM tblpartner
GROUP BY country_name
HAVING count(name) >= ALL
(SELECT distinct count(name)
FROM tblpartner
GROUP BY country_name
HAVING count(name) < ALL
(SELECT distinct count(name)
FROM tblpartner
GROUP BY country_name
HAVING count(name) >= ALL
(SELECT count(name)
FROM tblpartner
GROUP BY country_name)
)
)
)
)
ORDER BY 2 desc
============================================

try this on different RDBMS & let me know if you encounter any problem..

Raj