昨天要写的sql

代码
select * from grouptest, 
(
    
select code, MAX(createtime) as tt from dbo.GroupTest
    
group by code
) main 

where main.code = grouptest.code and main.tt = grouptest.createtime
group by id, grouptest.code
原文地址:https://www.cnblogs.com/zlfucku/p/1769540.html