且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

选择列中具有最大值的行-MySQL

更新时间:2022-03-17 21:31:42

尝试以下解决方案:

select MT.First, MT.Second, MT.Third, MT.Fourth 
from MyTable MT
join ( select first, max(Fourth) as Fourth
       from MyTable
       group by first
     ) T on T.first = MT.First
         and T.Fourth = MT.Fourth