/*分组统计时只能返回统计后的结果、比如要获得统计组最新插入的总条记录就不是很好办了、下面这条SQL语句希望可能帮到大家、*/
select * from MusicGood T1 left join (select count(*) as counts,max(addDate) as addDate from MusicGood group by MusicListID) T2 on T1.addDate = T2.addDate where counts is not null
/*分组统计时只能返回统计后的结果、比如要获得统计组最新插入的总条记录就不是很好办了、下面这条SQL语句希望可能帮到大家、*/
select * from MusicGood T1 left join (select count(*) as counts,max(addDate) as addDate from MusicGood group by MusicListID) T2 on T1.addDate = T2.addDate where counts is not null
转载于:https://www.cnblogs.com/billt/archive/2010/09/02/1815522.html