select * from a left join b on 复杂的连接条件
where a.Date > 20010101 and a.Date < 20011231如果该条件是b表的条件,可能会要
select * from a left join b on 复杂的连接条件 and 新条件视情况而定

解决方案 »

  1.   

    不是这样的,我首先要找出符合a.Date > 20010101 and a.Date < 20011231的检索结果,再加上符合a.Date > 20000101 and a.Date < 20001231的检索结果
      

  2.   

    也写成这样
    a.date between 20000101 and 20001231
    可以不加单引号
      

  3.   

    比如说a.Date > 20010101 and a.Date < 20011231的检索结果为
    No Name Age    Date   Money
    1   aa  25   20010205  1000
    2   bb  26   20011110  2000 a.Date > 20000101 and a.Date < 20001231的检索结果为
    No Name Age    Date   Money
    1   aa  25   20000205  3000
    2   bb  26   20001110  4000 我想把结果合并为
    No Name Age    DateA   MoneyA  DateB MoneyB
    1   aa  25   20000205  3000    20010205  1000
    2   bb  26   20001110  4000    20011110  2000