select b.productName, sum(a.productHow*c.price) totle from outCard a,outProduct b,product c where a.productName=b.outProductName and b.productName=c.productName and a.productName like '%插接板%'
group by productName

解决方案 »

  1.   

    select b.productName,totle = sum(a.productHow*c.price) 
    from outCard a,outProduct b,product c   
    where a.productName=b.outProductName and b.productName=c.productName and a.productName like '%插接板%'  
    group by productName
      

  2.   

    /*
    呵呵 --> 慢了9秒,主要是整理了一下格式
    */select b.productName, sum(a.productHow*c.price) totle from outCard a,outProduct b,product c where a.productName=b.outProductName and b.productName=c.productName and a.productName like '%插接板%'
    --group by productName
    group by b.productName
      

  3.   

    select b.productName,totle = sum(a.productHow*c.price) 
    from outCard a,outProduct b,product c   
    where a.productName=b.outProductName and b.productName=c.productName and a.productName like '%插接板%'  
    group by b.productName
      

  4.   

    都有错误啊!!!
    用:select b.productName,sum(a.productHow) from outCard a,outProduct b where a.productName=b.outProductName  group by a.productName having a.productName like '%插接板%' 和
    select distinct(b.productName),sum(a.productHow) from outCard a,outProduct b where a.productName=b.outProductName  group by a.productName having a.productName like '%插接板%'的效果是一样的
      

  5.   

    两位老师都报:列名 'productName' 不明确。
      

  6.   

    兄弟,你不是开玩笑吧?那这样呢?
    select productname , totle = sum(totle) from
    (
      select distinct(b.productName),(a.productHow*c.price)   totle   from   outCard   a,outProduct   b,product   c   where   a.productName=b.outProductName   and   b.productName=c.productName   and   a.productName   like   '%插接板%' 
    ) t
    group by productname