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 translate in oracle?
How can we find out the current date and time in oracle?
How to see free space of each tablespace?
Can we use bind variables in oracle stored procedure?
Hi Can any one tell me what are the API's used in requisition import.
How can you use check constraints for self referential integrity?
How does oracle handle read consistency?
How to call a stored function with parameters?
What is a connect identifier?
How to select some rows from a table in oracle?
What is Virtual Private Database in Oracle?
What are the numeric comparison operations?
how to make an oracle object
How to update a table row with a record?
What is the parameter mode that can be passed to a procedure?