Select
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a
如:
Isc Uoc
1 2
5 4
现在求的是Isc和Uoc的平均数,
然后我想在这个基础上再求,平均的Isc小于3大于0 并且 Uoc小于8 大于1的结果:
Isc Uoc
1 2问,怎么写?
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a
如:
Isc Uoc
1 2
5 4
现在求的是Isc和Uoc的平均数,
然后我想在这个基础上再求,平均的Isc小于3大于0 并且 Uoc小于8 大于1的结果:
Isc Uoc
1 2问,怎么写?
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a)twhere
isc>0 and isc<3
and
uoc<8 and uoc>1
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a
having AVG(Isc)>0 and AVG(Isc)<3 and AVG(Uoc)<8 and AVG(Uoc)>1
Select
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a
HAVING AVG(Isc) BETWEEN 0 AND 3 AND AVG(Uoc) BETWEEN 1 AND 8语句后面加上
求:
这个平均值在 0<平均值<3的平均值有哪些?
AVG(Isc) as Isc,
AVG(Uoc) as Uoc
from a)t
group by Isc,uoc
having AVG(Isc)>0 and AVG(Isc)<3 and AVG(Uoc)<8 and AVG(Uoc)>1