我尝试通过使用 Between 子句来实现查询,但这存在一些问题
S_E1 的第一个查询:
这个查询返回我需要的确切数据,这里的数据计数是 43。
select RECORD_TIMESTAMP as DateRecorded, ROUND (S_E1 ,2 )as S_E1
from TBL_SENSORS
Where RECORD_TIMESTAMP Between '4/28/2012 12 :00 AM'
and '5/17/2012 12 :00 AM'
And ( S_E1 Between 10 And 100 )
S_E2 的第二个查询:
这个查询返回我需要的确切数据,这里的数据计数是 68。
select RECORD_TIMESTAMP as DateRecorded, ROUND (S_E2 ,2 )as S_E2
from TBL_SENSORS
Where RECORD_TIMESTAMP Between '4/28/2012 12 :00 AM'
and '5/17/2012 12 :00 AM'
And ( S_E2 Between 10 And 100 )
问题 :
但是当我将这些查询组合到一个查询中时,它会给出错误的数据。它给了我 73 行。我认为它应该给 111 行
select RECORD_TIMESTAMP as DateRecorded,
ROUND (S_E2 ,2 )as S_E2,
ROUND (S_E1 ,2 ) as S_E1
from TBL_SENSORS
Where RECORD_TIMESTAMP Between '4/28/2012 12 :00 AM'
and '5/17/2012 12 :00 AM'
And ( S_E2 Between 10 And 100)
and (S_E1 Between 10 And 100 )
请给我一些想法我在这里错了..