首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

怎么提高sql语句的查询速度

2012-03-02 
如何提高sql语句的查询速度Stringstr selecttop80IDas序列号,projectnameas项目名,range25as25幅度,rang

如何提高sql语句的查询速度
String   str= "select   top   80   ID   as   序列号,   projectname   as   项目名,range25   as   25幅度,range50   as   50幅度, ";
        str=str+ "low1700   as   1700低频,middle1700   as   1700中心频率,   range1700   as   1700中心频率幅度, ";
        str=str+ "low2000   as   2000低频,middle2000   as   2000中心频率,   range2000   as   2000中心频率幅度, ";
        str=str+ "low2300   as   2300低频,middle2300   as   2300中心频率,   range2300   as   2300中心频率幅度, ";
        str=str+ "low2600   as   2600低频,middle2600   as   2600中心频率,   range2600   as   2600中心频率幅度   ";   // "2600中心频率幅度 "   与” ";   “之间应该有一个空格   否则出错
        str=str+ "from   error   where       projectname   <> ' "+ss+ " '   and   ID> 100   ";


ID   为   主键   和索引     projectname   索引


用的是   ADOQUER     查询  

ACCESS   没有存储过程   如何提高呀

[解决办法]
统计总数的话,就用你写的就行了,你的不涉及多表,多条件查询,在SQL语句上没什么可优化的了。
[解决办法]
同意楼上的意见
[解决办法]
就这个sql而言,加索引“projectname,ID”就可以了

热点排行