| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 513 人关注过本帖
标题:如何更快的查询数据
只看楼主 加入收藏
jxawgyl
Rank: 1
等 级:新手上路
帖 子:208
专家分:0
注 册:2007-10-16
结帖率:100%
收藏
 问题点数:0 回复次数:2 
如何更快的查询数据
现有四张表RecipeList,Outpatient ,Recipe,MedicineInspect ,查询每张表只要0.1秒时间,现建张视图表查询却要5分多,其如下:SELECT dbo.Outpatient.PatCode, dbo.Outpatient.PatName, dbo.Outpatient.Age,
      dbo.Outpatient.Sex, dbo.Outpatient.PatKindName, dbo.Outpatient.MedInsName,
      dbo.Outpatient.OffCode, dbo.MedicineInspect.MedName,
      dbo.MedicineInspect.MedSpec, dbo.MedicineInspect.StoreUnit,
      dbo.MedicineInspect.RoomUnit, dbo.MedicineInspect.ConvertUnit,
      dbo.MedicineInspect.MedSortCode, dbo.MedicineInspect.FinSortCode,
      dbo.MedicineInspect.PhaSortCode, dbo.MedicineInspect.MedModelCode,
      dbo.MedicineInspect.FivePen, dbo.MedicineInspect.Spell,
      dbo.MedicineInspect.Grade, dbo.MedicineInspect.MedSortName,
      dbo.MedicineInspect.FinSortName, dbo.MedicineInspect.PhaSortName,
      dbo.MedicineInspect.MedModelName, dbo.MedicineInspect.TendSortName,
      dbo.MedicineInspect.NongYi, dbo.MedicineInspect.ExecuteOffice,
      dbo.MedicineInspect.Sort, dbo.RecipeList.RecCode, dbo.RecipeList.Flow,
      dbo.RecipeList.MedCode, dbo.RecipeList.Number, dbo.RecipeList.RoomPrice,
      dbo.RecipeList.SendOpe, dbo.RecipeList.Sendtime, dbo.RecipeList.BackDrugOpe,
      dbo.RecipeList.BackDrugTime, dbo.RecipeList.BackChaOpe,
      dbo.RecipeList.ChargeOpe, dbo.RecipeList.CancelOpe, dbo.RecipeList.RoomCode,
      dbo.RecipeList.AddTime, dbo.RecipeList.DocCode, dbo.RecipeList.DocName,
      dbo.RecipeList.CancelSign, dbo.RecipeList.PreBackNum, '西药房' AS OffName,
      dbo.RecipeList.InsSign, dbo.RecipeList.AllMoney, dbo.RecipeList.SelfMoney,
      dbo.Operator.OpeName, dbo.Outpatient.OpeCode, dbo.Office.OffName AS OffName1,
      dbo.RecipeList.CheckSign, dbo.Recipe.YBRecCode
FROM dbo.RecipeList INNER JOIN
      dbo.Outpatient INNER JOIN
      dbo.Recipe ON dbo.Outpatient.PatCode = dbo.Recipe.PatCode ON
      dbo.RecipeList.RecCode = dbo.Recipe.RecCode INNER JOIN
      dbo.MedicineInspect ON
      dbo.RecipeList.MedCode = dbo.MedicineInspect.MedCode INNER JOIN
      dbo.Operator ON dbo.Outpatient.OpeCode = dbo.Operator.OpeCode INNER JOIN
      dbo.Office ON dbo.Outpatient.OffCode = dbo.Office.OffCode

请教各位应如何修改?
搜索更多相关主题的帖子: 数据 查询 
2010-09-30 08:41
bczgvip
Rank: 14Rank: 14Rank: 14Rank: 14
等 级:贵宾
威 望:66
帖 子:1310
专家分:5312
注 册:2009-2-26
收藏
得分:0 
怎么查都不成吧。
2010-09-30 16:22
wewyhy
Rank: 2
等 级:论坛游民
帖 子:7
专家分:10
注 册:2009-2-23
收藏
得分:0 
换个新计算机
2010-10-05 16:53
快速回复:如何更快的查询数据
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.018571 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved