Salve a tutti .
devo fare una query un po complicata.

esempio :

codice:
SELECT USERNAME,ORDER_CODE   
FROM ACCOUNT
INNER JOIN  (select distinct(FK) from FATTURE order by date desc) tab
on tab.FK = account.ID
in pratica, voglio visualizzare SOLAMENTE l'ultimo pagamento di ogni utente.

Sapete come fare? a me da errore e dice che non posso mettere l'order by nella subquery...