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 translate in oracle?

1051


How can we find out the current date and time in oracle?

1037


How to see free space of each tablespace?

969


Can we use bind variables in oracle stored procedure?

899


Hi Can any one tell me what are the API's used in requisition import.

1881


How can you use check constraints for self referential integrity?

920


How does oracle handle read consistency?

1052


How to call a stored function with parameters?

972


What is a connect identifier?

983


How to select some rows from a table in oracle?

1008


What is Virtual Private Database in Oracle?

1017


What are the numeric comparison operations?

1057


how to make an oracle object

2292


How to update a table row with a record?

962


What is the parameter mode that can be passed to a procedure?

982