Hi,
I am running a query that works as a subquery , but not as a join. Pls help:
This one works:
db2 => SELECT JOB FROM EMPLOYEE WHERE HIREDATE IN (SELECT MIN(HIREDATE) FROM EMP
LOYEE)
JOB
--------
FIELDREP
1 record(s) selected.
This one does not:
select job from employee a , employee b where min(a.hiredate)=b.hiredate
SQL0120N Invalid use of an aggregate functio or OLAP function
Can anyone pls suggest how to convert this subquery to a JOIN statement?
I am running a query that works as a subquery , but not as a join. Pls help:
This one works:
db2 => SELECT JOB FROM EMPLOYEE WHERE HIREDATE IN (SELECT MIN(HIREDATE) FROM EMP
LOYEE)
JOB
--------
FIELDREP
1 record(s) selected.
This one does not:
select job from employee a , employee b where min(a.hiredate)=b.hiredate
SQL0120N Invalid use of an aggregate functio or OLAP function
Can anyone pls suggest how to convert this subquery to a JOIN statement?