WITH T AS (select cd.*,ad.*,pd.*,ROW_NUMBER() over (partition by pd.clientID order by pd.paymentID desc) rowNumber
from ClientDetailTable cd inner join AddressDetailTable ad on cd.clientID = ad.clientID
inner join PaymentDetailTable pd on cd.clientID = pd.clientID)
select * from T where rowNumber = 1
In this query, you just need to replace table name with your table name.
Please let me know if you get the right solution from this query.