How to get top 1 record of each group in sql? Ask Question
By   Adil Shahbaz     17-Dec-2024    1 ;WITH cte AS ( SELECT *, ROW_NUMBER() OVER (PARTITION BY ID ORDER BY Date DESC) AS rn FROM Table ) SELECT * FROM cte WHERE rn = 1

Solutions


10099
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM