我正在从Microsoft Access查询第三方的Oracle视图表。以下查询:
SELECT CUST_NUMBER, TRANS_CODE, CASH_DRWR_DATE
FROM AMSUSER_CUSTHIST_VW
WHERE TRANS_CODE = 'CO'
AND CASH_DRWR_DATE BETWEEN #7/7/14# AND #7/14/14#
返回如下数据:
CUST_NUMBER TRANS_CODE CASH_DRWR_DATE
----------- ---------- ----------------------
0000718123 TR 01-31-2014
0000753077 NL 06-26-2014
0000738352 NL 04-02-2014
0000743210 NL 05-24-2014
...
0000695247 NL 06-03-2013
...
(Image of more results, some including times)
似乎没有遵守where
条款。除预期值外,TRANS_CODE
还包含CO
以外的值,有些日期超出指定范围。
但是,以下似乎有效:
SELECT CUST_NUMBER, TRANS_CODE, CASH_DRWR_DATE
FROM AMSUSER_CUSTHIST_VW
GROUP BY CUST_NUMBER, TRANS_CODE, CASH_DRWR_DATE
HAVING TRANS_CODE = 'CO'
AND CASH_DRWR_DATE BETWEEN #7/7/14# AND #7/14/14#
返回
CUST_NUMBER TRANS_CODE CASH_DRWR_DATE
----------- ---------- ----------------------
0000718123 CO 07-11-2014 10:02:31 AM
0000695247 CO 07-11-2014 10:13:57 AM
0000729449 CO 07-11-2014 10:10:25 AM
0000695715 CO 07-11-2014 9:45:51 AM
...
更奇怪的是,CUST_NUMBER
列对于两个查询都具有相同的数据,而其余信息则不同。
是否存在一些可能导致此行为的视图属性?