select*from a join students b on (a.id=b.id and a.price=b.price)
students表的列名如下
studentID | regionID | cityID | ChineseScore | MathScore | EnglishScore | PhysicsScore | chemistryScore | biologyScore |
---|
with a as(
select regionID,cityID,max(ChineseScore) from students group by regionID,cityID
)
select * from a join students b on (a.regionID=b.regionIDand a.cityID=b.cityID)