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
What is a select query statement in oracle?
State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.
How to select an oracle system id (sid)?
What is an oracle table?
How do I uninstall oracle client from windows?
What are the major difference between truncate and delete?
How to write a query with an inner join in oracle?
Use of an integrity constraint is better to validate data. Explain
What is user managed backup in Oracle?
What are triggers in oracle?
What is the difference between $oracle_base and $oracle_home?
How to retrieve values from data fields in record variables?
Is oracle a relational database?
Explain the use of tables option in exp command.
What is the use of oracle?