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...


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 

Answers were Sorted based on User's Feedback



i have a table with 3 columns country,empname,salary and i want the query for get the  name of ..

Answer / krish

Query to get 1st max salary from each dept
 
SELECT maxsal, 
       deptno, 
       ename 
FROM   ( 
                SELECT   Max(sal) OVER (partition BY detpno ORDER BY sal)        AS maxsal, 
                         row_number over (partition BY detpno ORDER BY sal DESC) AS id, 
                         ename, 
                         deptno 
                FROM     emp) 
WHERE  id=1;

just place id=2 instead of id=1 for second max salary 
if ur are expecting more than 1 records with max sal 
replace ROW_NUMBER with DENSE_RANK()

http://netezzamigration.blogspot.com/2014/10/analytic-functions-in-netezza.html

Is This Answer Correct ?    5 Yes 0 No

i have a table with 3 columns country,empname,salary and i want the query for get the  name of ..

Answer / 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

More Cognos Interview Questions

------Diff B/W DrillThrough and master and Detailed Report?

2 Answers   IBM,


Hi all, i have a requirement in Conditional drill through. I have a list report with Cities India, UK, USA, China, japan, Canada.... In the above cities i want to give Hyperlinks(Drill) for Only India & UK. Could you please send me the steps????

1 Answers  


What is defined as catalog and types of catalogs in Cognos?

0 Answers  


1.How will u link a list to crosstab.?i.e link a pramater in list so that it shows further information in cross tab.? 2.I have different regions,I want region specific logo to be displayed when I run the report.How it is done ? 3.Among Drill through and Master detail relationship which is more effective? 4.How do u hide a column in list report? Ans: In properties,Burn list option-check whichever column u wanna hide. 5.What is Roll play dimension? 6.What is Data Item Value n Parameter value?,What exactly it ll take when select either of them? 7.How many types of filters are there? 8.What will happen if u use detailed filter ?,n what is da result when used on summary filter?

0 Answers   TCS,


Can anyone tell me which automation tool is used in cognos,is it a testing tool or performance enhancing tool Thanks in advance

2 Answers   SAP Labs,


Difference between Express authoring mode and Professional authoring mode?

2 Answers   Wipro,


I want to schedule the report as sysdate-1.....how to do

2 Answers   TCS,


----------0Diff b/w Report Functions and Database functions?

1 Answers   IBM,


What is the use of Excel files in Cognos8?

1 Answers  


Can you define slice?

0 Answers  


is there any possibility to hide items other than render variable?

2 Answers   IBM,


what r the filters in fwm and report studio

6 Answers   TCS,


Categories