J'ai une table comme suivi de et j'ai besoin du dernier enregistrement de et j'ai essayé la requête comme celle-ci p>
3 Réponses :
Vous pouvez essayer d'utiliser row_number () code>
Utilisez Row_Number () CODE>
select t1.* from table t1
where t1.Amount= (select max(Amount) from table t2
where t1.cust_id=t2.cust_id)
Vous pouvez également essayer comme suit
select id,cust_id,amount from YourTable t1 where id =(select max(t2.id) from YourTable t2 where t2.Cust_ID=t1.Cust_ID) order by id
Bien sûr, vous avez fait vos recherches, s'il vous plaît partagez votre tentative et où vous êtes coincé.