当我这样做时:
select distinct
a.ano ano,
a.mes as mes,
count(*) as percentagem
from (
select substr(intfaims.f_aims_to_fecha@intfaims(nt.roster.dutyday@intfaims,0,2),5,2) as mes,
substr(intfaims.f_aims_to_fecha@intfaims(nt.roster.dutyday@intfaims,0,2),1,4) as ano
from nt.roster@intfaims
where nt.roster.LEG_FLT@intfaims > 0
) a
group by a.ano, a.mes
一切正常
但是当我应用选择时他们没有:
select *
from (
select distinct
a.ano ano,
a.mes as mes,
count(*) as percentagem
from (
select substr(intfaims.f_aims_to_fecha@intfaims(nt.roster.dutyday@intfaims,0,2),5,2) as mes,
substr(intfaims.f_aims_to_fecha@intfaims(nt.roster.dutyday@intfaims,0,2),1,4) as ano
from nt.roster@intfaims
where nt.roster.LEG_FLT@intfaims > 0
) a
group by a.ano, a.mes
) b
我明白了:
Error: no es una expression group by