I'm trying to get all duplicate rows using db_select
At the moment your query is:

SELECT 
FROM 
{node_revision} n
WHERE  (n.nid NOT IN SELECT MIN(n.nid)) 
GROUP BY hash


You need to add some fields...

db_select('node_revision', 'n')
  -&gt;fields('n', array('vid'))
  -&gt;where('n.nid NOT IN SELECT MIN(n.nid)')
  -&gt;groupBy('hash')
  -&gt;execute()
  -&gt;fetchAll();