CODE如下
select count(1) from summary.moneylog 1,
left join moneylog 2 
on 1.date=2.date
and 1.itemtype=2.itemclass
and 1.itemtype not in (1.2.3.4.5.6.7)
where date ='20120114'就是1.itemtype not in (1.2.3.4.5.6.7)
提示的错误!
请问怎么解决?

解决方案 »

  1.   

    not in里应该是  1,2,3,4,5,6,7  吧!
      

  2.   

    itemtype not in (1.2.3.4.5.6.7)
    改为
    itemtype not in (1,2,3,4,5,6,7)
      

  3.   

    select count(1) from summary.moneylog t1,
    left join moneylog t2  
    on t1.date=t2.date
    and t1.itemtype=t2.itemclass
    and t1.itemtype not in (1,2,3,4,5,6,7)
    where date ='20120114'select count(1) from summary.moneylog t1,
    left join moneylog t2  
    on t1.date=t2.date
    and t1.itemtype=t2.itemclass
    and (t1.itemtype <1 or t1.itemtype > 7)
    where date ='20120114'select count(1) from summary.moneylog t1,
    left join moneylog t2  
    on t1.date=t2.date
    and t1.itemtype=t2.itemclass
    and t1.itemtype not between 1 and 7
    where date ='20120114'
      

  4.   

    对不起大家 那是我打错了
    而且(1,2,3,4,5,6,7)不是这样的数字,是随机的
    所以BETWEEN不行!
      

  5.   


    对不起大家 那是我打错了
    而且(1,2,3,4,5,6,7)不是这样的数字,是随机的
    所以BETWEEN不行!
      

  6.   


    select count(1) from summary.moneylog a,
    left join moneylog b 
    on a.date=b.date
    and a.itemtype=b.itemclass
    and a.itemtype not in (1,2,3,4,5,6,7)
    where date ='20120114'