I have a query with an aggregate column (AVG(…)) and a YEAR(…) column in the select clause and I would like to have a GROUP BY YEAR(…) clause. This works in DB2, but only if I use a subquery such as : select hireyear, avg(salary)
from (select year(hiredate) as hireyear, salary
from emp) as tmp
group by hireyear
I would like to know if it’s possible to generate such a query with BO (4.1.3) ???
Reason : if the query is written as select year(hiredate), avg(salary) from emp, then BO generates a group by clause like group by year(hiredate) which is not accepted by DB2 !
I have a query with an aggregate column (AVG(…)) and a YEAR(…) column in the select clause and I would like to have a GROUP BY YEAR(…) clause. This works in DB2, but only if I use a subquery such as : select hireyear, avg(salary)
from (select year(hiredate) as hireyear, salary
from emp) as tmp
group by hireyear
I would like to know if it’s possible to generate such a query with BO (4.1.3) ???
Reason : if the query is written as select year(hiredate), avg(salary) from
emp, then BO generates a group by clause like group by year(hiredate) which
is not accepted by DB2 !