Q) How to Find Max Date from each Group? (Asked in Infosys
(INFI)Interview)
Answer Posted / d ashwin
AS OUR EXAMPLE HR SCHEMA FOR GROUP WISE MAX DATE...
SELECT * FROM HR.EMPLOYEES
WHERE HIRE_DATE IN
(SELECT MAX(HIRE_DATE) FROM HR.EMPLOYEES
GROUP BY DEPARTMENT_ID);
FOR SINGLE ROW MAX DATE...
SELECT * FROM
(
SELECT * FROM HR.EMPLOYEES
ORDER BY HIRE_DATE DESC)
WHERE ROWNUM = 1;
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain an exception and its types?
How to set a transaction to be read only in oracle?
What is recovery manager(rman) backup in Oracle?
Why do you create or replace procedures rather that drop and recreate.
How to use "in" parameter properly?
How to create an oracle testing table?
How to define a data source name (dsn) in odbc manager?
How to update values on multiple rows in oracle?
How to create a new table by selecting rows from another table?
What is dynamic proxy?
Assuming that you are an End User How to find that in the payment Batch some of the Invoice was Missing To pay How to find That??
What is the Tune Query
What are the differences between char and varchar2 in oracle?
How to recover a dropped table in oracle?
What is a named program unit?