易截截图软件、单文件、免安装、纯绿色、仅160KB

查询mssql大批量数据

数据库内有500W条数据,查询的时候如何优化
这段时间也在看SQL.我觉得这两本书不错!SQL艺术,SQL2008技术内幕 T-SQL基础.

确实写一条高效的SQL不是容易的事!我记得最清楚的一条是:最近过滤掉不符合条件的记录

500W.......这个结果谁看的完.
sql语句复杂的话,建议用存储过程. 优化明确精确的数据结果进行查询.

select distinct jixing,guige,danwei,zhuanhuanbi,shengchanqiye,tongyongming from bi_zhongbiaobiaozhunhua as m2 where exists (select id from bi_tongyong as m1 where m1.id=m2.tongyongming and exists (select tongyongname from bi_tongyong where tongyongname=m1.tongyongname and exists(select id from bi_shengchanqiye where id=bi_tongyong.shengchanqiye and shengchanqiye like'%神威药业%')) and shengchanqiye not in (select id from bi_shengchanqiye where shengchanqiye like '%神威药业%')) order by tongyongming desc
这样的一条语句,我已经在表中建了索引

这样的语句如何优化?


相关问答:

mssql如何只显示有重复的数据呢?

mssql如何只显示有重复的数据呢?
有重复的数据就显示一条重复的数据,没重复的不显示,查询语句该怎么写呢?谢谢

SQL code:
select distinct *
from tablename
where id in (
selec ......

MSSQL 2000 連接 MSSQL 2008

有沒有辦法實現,從MSSQL2000企業管理器註冊MSSQL2008數據庫?
连不上吧

貌似沒希望。。。

应该是不行的 跨太多了

那2000的 ......

150分求vbscript中判断mssql语法错误

在vbscript中不用on error resume next如何判断mssql语法错误!
TRY CATCH?


或者使用流程控制语句
if 
else


不用on error 用那个我就不需要在这里寻找答案

引用
不用on error 用那个我就不需 ......

请教在windows7下IIS7.5+PHP5.2+MSSQL的配置方法

如题~
请各位大虾指教~!
window xp/2003,你会配不?

现在最大的困难就是连接MSSQL的地方!
请说明白在IIS7.5的配置!WIN XP的不合适,我试过了

直接装个 phpnow?

貌似PHPNOW不支持IIS7.5吧

php ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号