-
I have a simple query problem,
If I write following query it works fine
Select max(hiredate), deptno from emp
group by Deptno;
It gives me three record which is fine, Now I also want the Sal and empno of the records, How Do I do it?
Thanks in advance
[Edited by irehman on 01-15-2002 at 11:15 PM]
-
solution for your simple query problem
[QUOTE]Originally posted by irehman
[B]I have a simple query problem,
If I write following query it works fine
Select max(hiredate), deptno from emp
group by Deptno;
It gives me three record which is fine, Now I also want the Sal and empno of the records, How Do I do it?
Answer:
Try to execute below query your problem will be solved..
select hiredate,deptno,empno,sal from emp
where (hiredate,deptno) in(select max(hiredate),deptno from emp group by deptno);
with regards
Mathur
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|