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

access怎么查询这个 - MS-SQL Server / 基础类

and id not in (select distinct client from tb_talk where DATEDIFF('d', #"&date&"#, adddate)<=45)

这个是从tb_client中找出超过45天没有在tb_talk 有记录的数据
结果貌似是对的
但效率太低了

我想这样应该快一点
and (select 1 from em_talk where client = tb_client.id DATEDIFF('d', #"&date&"#, adddate)<=45) 不存在
但不知应该怎么写
ACCESS中不知道有没EXISTS

SQL code:
select * from tb t where ... and not exists (select * from tb_talk where DATEDIFF('d', #"&date&"#, adddate)<=45 and t.id=client)


SQL code:
and id not in (select client from tb_talk where DATEDIFF('d', #"&date&"#, adddate)<=45)--去掉distinct


and not exists (select 1 from tb_talk where client = em_client.id and DATEDIFF('d', #"&date&"#, adddate)<=45)

这样可以了


相关问答:

求一sql语句 - MS-SQL Server / 疑难问题

现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......

linux不能访问access - Java / Java EE

rt,我试了网上直连Acces数据库的方法,windows下没有问题,但是在linux下不行,谁能给点提示?谢谢
你怎么连的?

Acces数据库..
你怎么练的呢?

Java code:

static String DBDRIVER = "sun.jd ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

SQL不明白 - MS-SQL Server / 应用实例

查询学生平均成绩及其名次 
  SELECT 1+(SELECT COUNT( distinct 平均成绩) 
  from (SELECT S#,AVG(score) AS 平均成绩 
  from SC&n ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号