|
SELECT T.NAME, T.DT, T.VAL, T1.VAL, T2.VAL, T3.VAL
FROM (SELECT T.NAME, [DT]+3 AS D3, T.VAL
FROM T) AS T3 INNER JOIN ((SELECT T.NAME, [DT]+2 AS D2, T.VAL
FROM T) AS T2 INNER JOIN ((SELECT T.NAME, [DT]+1 AS D1, T.VAL
FROM T) AS T1 INNER JOIN T ON (T1.D1 = T.DT) AND (T1.NAME = T.NAME)) ON (T2.D2 = T.DT) AND (T2.NAME = T.NAME)) ON (T3.D3 = T.DT) AND (T3.NAME = T.NAME)
WHERE (((T.VAL)>=[M]) AND ((T1.VAL)>=[M]) AND ((T2.VAL)>=[M]) AND ((T3.VAL)>=[M]));
对于数据处理access肯定能做,上面的查询引用表"T",得到你要的第一个结果. |
|