Modrá je dobrázelená je lepšíLopuch.cz
SELECT @poradi := @poradi + 1 AS poradi, jmeno, pocet FROM (SELECT @poradi := 0) p, body ORDER BY 1;
SELECT (select count(*) from body b where b.pocet > body.pocet) + 1 AS poradi, jmeno, pocet FROM body ORDER BY 1;
select a.zavodnik, (select count(*) from tabulka b) - (select count(*) from tabulka c where c.body<a.body) poradi from tabulka a order by 1 desc