Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is a select query statement in oracle?

1026


State the difference along with examples between Oracle 9i, Oracle 10g and Oracle 11i.

1094


How to select an oracle system id (sid)?

1120


What is an oracle table?

1031


How do I uninstall oracle client from windows?

1057


What are the major difference between truncate and delete?

1130


How to write a query with an inner join in oracle?

1094


Use of an integrity constraint is better to validate data. Explain

1088


What is user managed backup in Oracle?

1202


What are triggers in oracle?

1096


What is the difference between $oracle_base and $oracle_home?

1136


How to retrieve values from data fields in record variables?

1171


Is oracle a relational database?

966


Explain the use of tables option in exp command.

1166


What is the use of oracle?

1075