i have a table with 3 columns country,empname,salary and i want the query for get the  name of the employees who is getting top 2 nd highest salary for individual country?
Thanks in advance 

Answer Posted / madhu

select * from ( select country,empname,salary, dense_rank() over (partition by country order by salary) rank from emp) where rank <= 2;

Is This Answer Correct ?    4 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you mean by drill through report?

579


hi, this is harish. i had finsihed cognos course recently.can some one help in the area of project explination, interview questions,real time scenarious....this is my maild id nanagupta907@gmail.com

1521


Which lifecycle we will use for reporting?

565


What is the diff between the following Report output-- HTML O/P, PDF O/P, EXCEL 2000 and EXCEL 2003 of report outputs? Listout main differences?

1620


How to a create header dynamically in a crosstab report in cognos 8.1?

1991






How to create model and how to test model?

620


What are the different types of important services used in cognos?

588


How to limit the cut,copy and paste operations for an user in reportlevel? Can anyone please send me the steps as i am new to cognos?

2163


How to Reset Pagenumbers in one report.

2214


What are shortcuts? Where it can be used? What are the advantages?

555


What you mean by drill across?

616


how to perform single sign in cognos by using url?

567


------------------What is Inline Query?

1794


can we insert all types of charts in a list report? what r the realtime prompts?

1673


I have ten columns that needs to be totalled... but some columns are empty...how do i get sum all the columns even if sum are empty? Can i get a total of the rows instead of columns? if yes, what is the function to be used?

1534