如果每个accent的result=1时的Modulus都相同的话,可以这么写:Select a.accent,b.anum,b.anum*a.modulus as product from (Select distinct( Accent), modulus From Statis where result=1) as a inner join(Select Accent, count(*) as anum From StatisWhere time between '2011-4-1' and '2011-4-30' and result=1group by accent) as b on a.accent=b.accent
以下语句可以得出每个Accent的Result=True的数量Select Accent, count(*)From StatisWhere time between '2011-4-1' and '2011-4-30'group by accent
having accent=1题目本身有问题, 对于每个Accent在