qq_31738715
笑看今生
2017-09-13 03:12

数据库sql优化问题帮忙看看指教下

  • 优化
  • 数据库
  • sql

select parking.*, sum(stub_group.fastStubCount)+sum(stub_group.slowStubCount) as stubCount
from parking
left join parking_stub_relation on parking.ParkingID=parking_stub_relation.parkingId
left join stub_group on (stub_group.id=parking_stub_relation.stubGroupId and parking_stub_relation.parkingStubStatus=1)
left join business_area on parking.BusinessAreaId = business_area.businessAreaId

where parking.parkingKind =1

group by parking.ParkingID
order by parking.aboveseaLevel desc

    把这条sql优化,请大神帮帮看看
  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答