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 oracle data types with examples?
How to insert a new row into a table in oracle?
What is raw datatype?
What is system tablespace?
What do you mean by merge in oracle and how can we merge two tables?
How to empty your oracle recycle bin?
What are the execution control statements?
How remove data files before opening a database?
How to pass a parameter to a cursor in oracle?
Explain the dml?
What do database buffers contain?
What is merge in oracle?
How to drop a stored function?
What is meant by a deadlock situation?
How do I limit the number of rows returned by an oracle query after ordering?