Prova:
codice:
SELECT n, data, costo 
from tabella 
where N = '1'
ORDER by data DESC
LIMIT 1