标题:[求助]数据库查询问题,急晕了~
取消只看楼主
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
 问题点数:0 回复次数:15 
[求助]数据库查询问题,急晕了~

搜索语句:
SELECT Top 1000 seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate FROM v_seekerInfo WHERE isvalid = 1 AND ( MaxEduLevel >= 20 AND MaxEduLevel <= 70) AND (age >= 18 AND age <= 60) AND abs(DateDiff(d,Getdate(),LastUpdateDate))<=90 and (( seekjobpos1 like '%人事%' Or seekjobpos2 like '%人事%' Or seekjobpos3 like '%人事%' Or otherSkills like '%人事%' Or selfeval like '%人事%' Or devDirection like '%人事%' Or school like '%人事%' Or magjor like '%人事%' Or companyname like '%人事%' Or workdes like '%人事%' ) or ( seekjobpos1 like '%采购%' Or seekjobpos2 like '%采购%' Or seekjobpos3 like '%采购%' Or otherSkills like '%采购%' Or selfeval like '%采购%' Or devDirection like '%采购%' Or school like '%采购%' Or magjor like '%采购%' Or companyname like '%采购%' Or workdes like '%采购%' )) GROUP BY seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate ORDER BY lastUpdateDate DESC


老数据库(16万条数据),新数据库(17万条)

v_seekerInfo为表单视图,结构确定没改变过(大概连接了7个表单)

在老数据库运行上面查询语句没问题,但在新的数据库就显示:

Microsoft OLE DB Provider for SQL Server 错误 '80040e31'

超时已过期

请各位大侠帮忙看看是存在什么问题,会导致这样的错误!?

搜索更多相关主题的帖子: 数据库 查询 
2006-11-07 09:18
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
可能存在的情况也说下拉!UP!
2006-11-07 09:46
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
但要求搜索的方式就得有这么多条件,有什么办法解决吗?

怎么才可以整理顺一点?
2006-11-07 10:12
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
上面是双关键字搜索,有什么好方法解决吗?
2006-11-07 10:13
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
谢谢,试下!
2006-11-07 10:20
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
还是一样的!哭啊
2006-11-07 10:39
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
SELECT t1.SeekerID, t1.MaxEduLevel, t1.maxEduSchool, t1.maxEduCourse, t1.birthday,
t1.Gender, t1.WorkPos, t1.homePos, t2.WantJobPos1, t2.WantJobPos2,
t2.WantJobPos3, t3.WorkPos1, t3.WorkPos2, t3.WorkPos3, t2.SeekJobPos1,
t2.SeekJobPos2, t2.SeekJobPos3, t4.IsValid, DATEDIFF(year, t1.birthday, GETDATE())
AS age, t5.workedYear, t1.HasPhoto, t4.LastUpdateDate, t1.TrueName,
t1.WorkPos AS nowpos, t5.otherSkills, t1.selfEval, t1.devDirection, t6.School,
t6.Magjor, t7.CompanyName, t7.WorkDes
FROM dbo.t_jSkDetail t1 LEFT OUTER JOIN
dbo.t_jSKEdu t6 ON t1.SeekerID = t6.SeekerID LEFT OUTER JOIN
dbo.t_jSKexperience t7 ON t1.SeekerID = t7.SeekerID LEFT OUTER JOIN
dbo.t_jSKJobPosIntent t2 ON t1.SeekerID = t2.SeekerID LEFT OUTER JOIN
dbo.t_jSKWorkPosIntent t3 ON t1.SeekerID = t3.SeekerID LEFT OUTER JOIN
dbo.t_jobSeeker t4 ON t1.SeekerID = t4.SeekerID LEFT OUTER JOIN
dbo.t_jSKSkill t5 ON t1.SeekerID = t5.SeekerID
WHERE (t1.version = 0) AND (t2.version = 0 OR
t2.version IS NULL) AND (t3.Version = 0 OR
t3.Version IS NULL) AND (t5.Version = 0 OR
t5.Version IS NULL) AND (t4.IsValid = 1)
2006-11-07 11:05
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
发了,没人回,上面是视图结构,帮忙看看!
2006-11-07 11:06
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
试了,旧数据2777条数据5秒,新数据库45000条数据55秒,有什么办法可以弄快点?
2006-11-07 15:43
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
得分:0 
速度问题解决,去掉“ORDER BY lastUpdateDate DESC ”就快了

但排序没了,帮忙!
2006-11-07 16:24



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-101194-1-1.html




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

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