Q: Getting rows with duplicate column values I tried this with solutions avaialble online, but none worked for me.
Table :
Id rank 
1  100
1  100
2  75
2  45
3  50
3 50

I want Ids 1 and 3 returned, beacuse they have duplicates. 
I tried something like
 select * from A where rank in ( 
 select rank from A group by rank having count(rank) > 1

This also returned ids without any duplicates. Please help.

A: Try this:
select id from table
group by id, rank
having count(*) > 1


A: select id, rank
from
(
    select id, rank, count(*) cnt
    from rank_tab
    group by id, rank
    having count(*) > 1
) t


A: This general idea should work:
SELECT id
FROM your_table
GROUP BY id
HAVING COUNT(*) > 1 AND COUNT(DISTINCT rank) = 1

In plain English: get every id that exists in multiple rows, but all these rows have the same value in rank.

If you want ids that have some duplicated ranks (but not necessarily all), something like this should work:
SELECT id
FROM your_table
GROUP BY id
HAVING COUNT(*) > COUNT(DISTINCT rank)

