weixin_39899021的博客#DATEDIFF(date1,date2)返回两个日期之间的天数 select customer_name, timestampdiff(month,max(order_time),'2016-13-31') as R, timestampdiff(month,min(order_time),max(order_time)) as L from market_...
学习_学习_再学习的博客第一个排完后,按照第二个字段, 聚合、分组 聚合函数:count/max/min/avg/sum/round/ group_concat() 分组和聚合一起使用:group by mysql> select gender,group_concat(name,"_",age," ","id") from students group ...