select ID,AVG(fPrice) as avgPrice from Price
where Hp_Date >='2017-07-04' and Hp_Date <='2017-07-06'
group by ID
having SUM(case when ISNULL(fPrice,0) > 0 and Status=0 then 1 else 0 end)=天数
2024-01-05 22:00:58
select ID,AVG(fPrice) as avgPrice from Price
where Hp_Date >='2017-07-04' and Hp_Date <='2017-07-06'
group by ID
having SUM(case when ISNULL(fPrice,0) > 0 and Status=0 then 1 else 0 end)=天数
下一篇:Java基础点滴