你可以用compute by 你的列 试试,
具体到sqlserver版问问邹建等高手。^_^
我曾得到他的大力帮助。^_^

解决方案 »

  1.   

    select ip_type,nvl(sum(if.if_realfee),0) if_realfee 
    from ip,ipfee if 
    where ip.ip_tel=if.ip_tel 
    and if.if_rectype in ('0','1') 
    and if.if_date>=to_date('2003-10-1','yyyy-mm-dd') 
    and if.if_date<=to_date('2003-10-1','yyyy-mm-dd') 
    group by ip_typehaving sum(ip_type)>100依数据库不同而不同,以上是SQL SERVER的用法。
      

  2.   

    select ip_type,nvl(sum(if.if_realfee),0) if_realfee 
    from ip,ipfee if 
    where ip.ip_tel=if.ip_tel 
    and if.if_rectype in ('0','1') 
    and if.if_date>=to_date('2003-10-1','yyyy-mm-dd') 
    and if.if_date<=to_date('2003-10-1','yyyy-mm-dd') 
    group by ip_type 
    having nvl(sum(if.if_realfee),0) > 100