7,712
社区成员
发帖
与我相关
我的任务
分享
SELECT * FROM dist AS c
WHERE exists(select [datatime] from (select count(*) as n ,[datatime] from [dist] group by [datatime]) d where c.datatime = d.datatime and n =8);
得出的是 14272条数据,
SELECT *
FROM [Table] AS a
WHERE
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='W40lp-S ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='W40lp-M ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='W20lp-S ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='W20lp-M ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='T40lp-S ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='T40lp-M ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='T20lp-S ' )
and
exists(select 1 from [Table] where a.SN=SN and a.datatime=datatime and pos='T20lp-M' )
;
上述本来想找出同样结果所以把 Judge = true 去掉,但在access新建查询后一开始查找就查死机, 所以没测出来
select ID,Time
from 表
where result='True'
group by ID,Time
having sum(pos)=10