from shop t1 left join goods t2 on t1.shop_id=t2.shop_id
group by t1.shop_id
order by count(1) desc
SELECTCOUNT(DISTINCT user_id) user_count,
CASE
WHEN age <= 10 THEN '0-10'
WHEN age > 10 AND age <= 20 THEN '10-20'
WHEN age > 20 AND age < 30 THEN '10-30'
END AS `age
FROM
tableName
GROUP BY age
ORDER BY age desc
直接在limit 前面 加一个排序 这里我以 创建时间为例 以创建时间 倒序排列$sql="select * from qt_1018 order by createtime desc limit $rbe,$pagesize"欢迎分享,转载请注明来源:内存溢出
评论列表(0条)