Identify duplicates and apply logic
I would try locating all duplicates and their respective highest secondary values like this:

SELECT
  StringColumn,
  MAX(SecondaryColumn) AS HighestValue
FROM
  atable
GROUP BY
  StringColumn
HAVING
  COUNT(*) &gt; 1


and then using the results to produce the final set like this:

SELECT
  t.StringColumn,
  t.SecondaryColumn
FROM
  atable AS t
  INNER JOIN
  (
    SELECT
      StringColumn,
      MAX(SecondaryColumn) AS HighestValue
    FROM
      atable
    GROUP BY
      StringColumn
    HAVING
      COUNT(*) &gt; 1
  ) AS s ON t.StringColumn = s.StringColumn
        AND t.SecondaryColumn &lt;&gt; s.HighestValue
;


I believe an index on (StringColumn, SecondaryColumn) should help the performance.