Oracle中的SQL如下(改造前):
select username,PARTITION BY age order by age desc uuid
from
( select uuid ,username ,`password` ,age from `user` ) b
GROUP BY uuid asc;
(网上copy的代码,有误,但我们关注的重点是关键字改造替换后的区别!)
MySQL中的SQL如下(改造后):
select username,SUBSTRING_INDEX( GROUP_CONCAT(age order by age desc) ,',',1) uuid from ( select uuid ,username ,`password` ,age from `user` )b GROUP BY uuid asc;