• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
红色石头
热情的血液+石头的冰冷
博客园    首页    新随笔    联系   管理    订阅  订阅
对多表联合查询的SQl语句的改进,大幅提高查询性能
常用的多表联合查询的sql语句:
select table1.ID from table1 inner join table2 on table1.ID=table2.ID
 where  table2.col2='xxx'

改进后:
select a.ID from table1 a,
(select col1,ID from table2 where col2='xxx') b
 where a.ID=b.ID
posted on 2006-07-13 14:56  红色石头  阅读(5874)  评论(5)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3