首页 新闻 会员 周边 捐助

帮我优化一个access数据库查询语句

0
悬赏园豆:15 [已解决问题] 解决于 2013-01-23 12:29

以下access数据库语句怎么优化,效率在数据数为3000时,执行很差
SELECT   top 10 jobid,classid,jobname,provincecode,citycode,peaplenum,publishtime,remark,(SELECT count(jobid) FROM t_jobs WHERE  isdelete=0  and ( jobname like '%销%')  )  as totalcount,(select name from t_classify where t_jobs.classid=t_classify.classid and  t_classify.isdelete=0) AS classname  FROM t_jobs WHERE  isdelete=0  and ( jobname like '%销%')   and jobid not in (select top 50 jobid from t_jobs where  isdelete=0  and ( jobname like '%销%')   order by jobid desc ) order by jobid desc

kiddy-star的主页 kiddy-star | 初学一级 | 园豆:196
提问于:2013-01-22 11:57
< >
分享
最佳答案
0

SELECT top 10 jobid,

classid,
jobname,
provincecode,
citycode,
peaplenum,
publishtime,
remark,
table_b.totalcount,
table_c.classname
FROM t_jobs,
(SELECT count(jobid) as totalcount
FROM t_jobs
WHERE isdelete = 0
and jobname like '%销%') as table_b,
(select name AS classname
from t_classify
where t_jobs.classid = t_classify.classid
and t_classify.isdelete = 0) as table_c
WHERE isdelete = 0
and (jobname like '%销%')
and not exists (select top 50 jobid
from t_jobs
where isdelete = 0
and jobid = t_jobs.jobid
and (jobname like '%销%')
order by jobid desc)
order by jobid desc

收获园豆:10
vancegf | 菜鸟二级 |园豆:234 | 2013-01-22 12:32

非常感谢。

kiddy-star | 园豆:196 (初学一级) | 2013-01-23 12:28
其他回答(1)
0

access....sqlite都比access性能高..

收获园豆:5
wdwwtzy | 园豆:114 (初学一级) | 2013-01-23 12:12
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册