SELECT * FROM foo WHERE name='baz' ORDER BY bar ASC
?! Ou j'ai pas compris la question?
Et la position directe d'un mec
SELECT COUNT(*)+1 AS position
FROM foo AS f
WHERE f.bar > (SELECT bar FROM foo WHERE id = ?) [AND f.name = 'baz']
Après, faut voir les placements ex-aequo.