Ask Experts Questions for FREE Help !
Ask
    Kalpana_pipl's Avatar
    Kalpana_pipl Posts: 1, Reputation: 1
    New Member
     
    #1

    Aug 14, 2008, 01:16 AM
    Oracle Group By Clause
    Hi all,

    How to select a field that is not a part of the Group By clause?

    Suppose a table contains Emp_No, Emp_Name,Dept_No,Salary...
    I have to select the emp_no or emp_name who are get the maximum salary in Dept_No wise..
    How do I achieve this through a single SQL ?
    Guide me

    Thanks is advance...
    ordba's Avatar
    ordba Posts: 11, Reputation: 1
    New Member
     
    #2

    Dec 8, 2008, 05:16 PM

    Try and use subselect...

    Select emp_name from
    (select emp_name,dept_no,max(salary) from emp group by emp_name,dept_no);

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Group - A & Group-T shares [ 2 Answers ]

Hi, I just want to know what are Group-A shares & Group-T shares and what we mean by that. On what basis this groupings are done

What is noun clause and when do we use it? [ 1 Answers ]

What is noun clause and when do we use it?

No Termination Clause [ 6 Answers ]

We signed a new lease agreement with our landlords Aug. 1st and was to end May 1, 2008. They added a clause this time that they may choose to sale the home anytime during our lease but probably wouldn't start showing it until next spring. A few weeks later they had a realtor in this subdivision...

Elastic clause [ 1 Answers ]

Fill in the blank The elastic clause is the source of the central government's ___________ powers.

What name of business clause is this [ 2 Answers ]

What is the name of a clause that you agree to when you sell a practice to another and you are unable to do this practice again in the same province for 7 years? What are the rules of this particular clause?


View more questions Search