Subject | Re: [firebird-support] SQL:use aggregate function without "group by" |
---|---|
Author | Anderson Farias |
Post date | 2008-09-01T12:32:17Z |
Hi,
(firebird) ::
select extract(year from RECORD.START_PERIOD-5),
avg(RECORD.CALCULATED_VALUE)
from RECORD
where RECORD.ID = 2
GROUP BY 1
?
Regards,
Anderson Farias
> (example is in Oracle):I have almost no knowledge on Oracle, so, how is this distinct from
> "select distinct TO_CHAR(RECORD.START_PERIOD-5, 'YYYY'),
> avg(RECORD.CALCULATED_VALUE)
> over (partition by TO_CHAR(RECORD.START_PERIOD-5, 'YYYY'))
> from RECORD
> where RECORD.ID = 2".
(firebird) ::
select extract(year from RECORD.START_PERIOD-5),
avg(RECORD.CALCULATED_VALUE)
from RECORD
where RECORD.ID = 2
GROUP BY 1
?
Regards,
Anderson Farias