Su che db? Per esempio su Oracle hai il rownum

codice:
SELECT ROWNUM, CAMPO1, CAMPO2 FROM TABELLA