SELECT
a.id,
a.order_type,
a.user_id,
GROUP_CONCAT(b.star_id) AS starIdStr,
GROUP_CONCAT(c.weibo_user_id) AS weiboIdStr,
sum(order_amount) AS sumPrice,
a.order_time
FROM
tb_order_info AS a
INNER JOIN tb_order_star AS b
INNER JOIN tb_star AS c
WHERE
(
a.id = b.order_id
AND b.star_id = c.id
)
group by a.id
order by a.order_time desc
![clipboard.png](/img/bVYT72)
分组后按user_id 取时间最近的那一条 。怎么取 求大神 ,php思路也行。
添加回答
举报
0/150
提交
取消