查询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如何只显示有重复的数据呢?
有重复的数据就显示一条重复的数据,没重复的不显示,查询语句该怎么写呢?谢谢
SQL code:
select distinct *
from tablename
where id in (
selec ......
有沒有辦法實現,從MSSQL2000企業管理器註冊MSSQL2008數據庫?
连不上吧
貌似沒希望。。。
应该是不行的 跨太多了
那2000的 ......
在vbscript中不用on error resume next如何判断mssql语法错误!
TRY CATCH?
或者使用流程控制语句
if
else
不用on error 用那个我就不需要在这里寻找答案
引用
不用on error 用那个我就不需 ......
如题~
请各位大虾指教~!
window xp/2003,你会配不?
现在最大的困难就是连接MSSQL的地方!
请说明白在IIS7.5的配置!WIN XP的不合适,我试过了
直接装个 phpnow?
貌似PHPNOW不支持IIS7.5吧
php ......