mysql分组取前N

原始数据如下:

按city分组,id顺序取前两条:

 按city分组,id逆序取前两条:

原文地址:https://www.cnblogs.com/playforever/p/11771480.html