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)
这样可以了
相关问答:
可能因为工作的原因 接触数据库这块比较少,之前都是做程序这块,数据库这块都有专门的人来做 分工都很明细 所以对数据库这一块完全不了解。前段时间 去面试了几家公司 几乎都是在数据库这块挂掉的 连个简单的SQ ......
有一个数据库里只有2W条数据不到,却有500M那么大,怎么回事啊?是ACCESS的数据库。后来我把ACCESS导入到MSSQL中,也占用了500M左右的空间,如果压缩数据库呢?请高手指点
压缩数据库?能做到么...
期待高人指点 我 ......
如何在SQL2005中设定定时作业,比如说定时清理某些表的数据,
或者是定时的将某些表的数据导出excel!
在线等待,急急急,最好是详细步骤!
之前我做的作业有点问题!
帮UP
参考:http://hi.baidu.com/toiota ......
下面是XML初始文件内容
XML code:
<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/Up ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......