MySql里面应该怎样优化这条sql语句?

wujumao 2009-08-17 01:46:21
select p.id,p.nickname,p.grade,p.union_name,c.x,c.y from player_info p ,city c where p.u_id=c.u_id group by p.p_id order by p.p_grade desc limit 0,10
...全文
53 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
SQL77 2009-08-17
  • 打赏
  • 举报
回复
select
p.id,p.nickname,p.grade,p.union_name,c.x,c.y
from player_info p ,
city c w
here p.u_id=c.u_id
group by p.p_id
order by p.p_grade desc limit 0,10

语句好像没什么好优化的,加索引
flyfly2008 2009-08-17
  • 打赏
  • 举报
回复

select p.id,p.nickname,p.grade,p.union_name,c.x,c.y from player_info p join inner city c on p.u_id=c.u_id group by p.p_id order by p.p_grade desc limit 0,10
wujumao 2009-08-17
  • 打赏
  • 举报
回复
select p.id,p.nickname,p.grade,p.union_name,c.x,c.y from player_info p ,
city c where p.u_id=c.u_id group by p.p_id order by p.p_grade desc limit 0,10

34,594

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧