SET @row = 0;
SELECT * FROM (
SELECT *, @row := @row + 1 AS `pos`
FROM (
SELECT `t1`.`id`, `t1`.`hm`, `t2`.`name`
FROM (
SELECT `target_id` AS `id`, SUM(`cnt`) AS `hm`
FROM `votes`
GROUP BY `target_id`
) AS `t1`
JOIN `people` AS `t2` ON `t2`.`id` = `t1`.`id`
ORDER BY `t1`.`hm` DESC, `t2`.`name` ASC
LIMIT 10
) AS `x`
) AS t3
WHERE `id`=??