标签:order 需要 sql order by select img concat name image
需求是 查询每个班 年龄最小的那个人 ,需要显示如下:
SQL 语句如下:
select id,
SUBSTRING_INDEX(GROUP_CONCAT(age order by age),‘,‘,1) as age,
SUBSTRING_INDEX(GROUP_CONCAT(username order by age),‘,‘,1) as userName
from person
GROUP BY id
标签:order 需要 sql order by select img concat name image
原文地址:https://www.cnblogs.com/refuge/p/9061383.html