sql 分组查询效率

场景:分组查询每种类型 ID值最大 的记录;mysql             mysql数据库30W数据量。sql 写法一:数据库 select * from test1 t1 where t1.id in( select MAX(t.id) as id from test1 t   GROUP BY t.col1   ) spa 耗时超过30秒;test 写法二:select select t
相关文章
相关标签/搜索