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 productName
from outCard a,outProduct b,product c
where a.productName=b.outProductName and b.productName=c.productName and a.productName like '%插接板%'
group by productName
呵呵 --> 慢了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
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
用: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 '%插接板%'的效果是一样的
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