| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 990 人关注过本帖
标题:[求助]数据库查询问题,急晕了~
取消只看楼主 加入收藏
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
收藏
 问题点数:0 回复次数:2 
[求助]数据库查询问题,急晕了~

搜索语句:
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'

超时已过期

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

搜索更多相关主题的帖子: 数据库 like AND 人事 age 
2006-11-07 09:21
滚水六脚
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:04
滚水六脚
Rank: 1
等 级:新手上路
帖 子:132
专家分:0
注 册:2004-8-16
收藏
得分:0 

CREATE PROCEDURE [sp_Seekerinfo]
As
Begin
declare @LastUpdateDate varchar(50)
declare @GetSearch Nvarchar(600)
declare @s Nvarchar(1000)
set @s = 'SELECT Top 1000 seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate FROM v_seekerInfo WHERE isvalid = 1 '+@GetSearch+' GROUP BY seekerID,trueName,gender,age,MaxEduLevel,maxEduSchool,maxEduCourse,WorkPos,LastUpdateDate order by '+@LastUpdateDate+' desc'
Exec(@s)
exec sp_executesql @s
End
GO
听各位忠告已经做了储存过程,不过不知道怎么调用,老出错
调用代码:
<!--#include file="common/conn.asp" -->
<% Set cmd = Server.CreateObject("Adodb.Command")
Set Rs_Category = Server.CreateObject("Adodb.Recordset")
strCause=" and ( MaxEduLevel >= 20 AND MaxEduLevel <= 70) AND (age >= 18 AND age <= 60) AND abs(DateDiff(d,Getdate(),LastUpdateDate))<=90 "
cmd.ActiveConnection = dbconn
cmd.CommandText = "sp_Seekerinfo"
cmd.CommandType = &H0004
cmd("@LastUpdateDate")="LastUpdateDate"
cmd("@GetSearch") = strCause

Set Rs_Category = cmd.Execute()
While Not Rs_Category.Eof
Response.Write(Rs_Category("trueName")&"<br>")
Wend
Set Rs_Category = Nothing
Set Cmd = Nothing %>

ADODB.Command 错误 '800a0cc1'

在对应所需名称或序数的集合中,未找到项目。

/****.asp,行 8

2006-11-08 17:53
快速回复:[求助]数据库查询问题,急晕了~
数据加载中...
 
   



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

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