| Pk | ID | D |
| 1 | 2 | 20 |
2 | 3 | 46 |
| 3 | 2 | 23 |
| 4 | 3 | 56 |
| 5 | 4 | 55 |
| 6 | 4 | 12 |
find max D value of distinct ID
| Pk | ID | D |
| 1 | 2 | 20 |
2 | 3 | 46 |
| 3 | 2 | 23 |
| 4 | 3 | 56 |
| 5 | 4 | 55 |
| 6 | 4 | 12 |
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sumit JoshiRank #1,252 · 1.4K reputationPosted Aug 16, 2015, 9:08 PM EDT
Manas MohapatraRank #182 · 13.2K reputationPosted Aug 16, 2015, 9:14 PM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Aug 16, 2015, 10:26 PM EDT
select MAX(D) as D, ID from TestTable group by ID