select avg(taste*1.0) ,avg(Environment*1.0),avg(service*1.0),avg(PerConsumption*1.0) from xl_storescore where 付费商家流水号=1 试试
select avg(a*1.0) from ( select 8 as a union all select 8 union all select 9 )tb /*--------------------------------------- 8.333333(1 行受影响) */select cast(avg(a*1.0) as decimal(18,2)) from ( select 8 as a union all select 8 union all select 9 )tb /*--------------------------------------- 8.33(1 行受影响)*/
from xl_storescore
where 付费商家流水号=1
试试
from
(
select 8 as a union all
select 8 union all
select 9
)tb
/*---------------------------------------
8.333333(1 行受影响)
*/select cast(avg(a*1.0) as decimal(18,2))
from
(
select 8 as a union all
select 8 union all
select 9
)tb
/*---------------------------------------
8.33(1 行受影响)*/