Is it possible to use Rank in a Where Clause. Below is the code that I am intending to use
Select
DebtorID
,Rank () over (partition by DebtorID order by BalanceDate) as RankBalanceDate
,BalanceDate
,Balance
,UnallocatedBalance
,Overdue
From Debtorbalances
Where Rank () Over (Partition by DebtorID order by BalanceDate) = 1
Aucun commentaire:
Enregistrer un commentaire