mysql先排序后分组,mysql排序是全部查出来再排吗

首页 > 社会 > 作者:YD1662025-06-15 06:13:39

mysql先排序后分组,mysql排序是全部查出来再排吗(1)

用分组函数来做,假如你的表名是table_nameselect A.*from table_name A,(select product,max(date) max_date from table_name group by product) Bwhere A.product=B.product and A.date=B.max_date;

栏目热文

文档排行

本站推荐

Copyright © 2018 - 2021 www.yd166.com., All Rights Reserved.