write a query to display to 10 max record from the employee
table?

Answers were Sorted based on User's Feedback



write a query to display to 10 max record from the employee table?..

Answer / sandy

select top 10 * from employee order by salary desc

Is This Answer Correct ?    6 Yes 3 No

write a query to display to 10 max record from the employee table?..

Answer / phoebe

select * from
(
select * from employee
order by salary desc)
where rownum<11;

Is This Answer Correct ?    4 Yes 2 No

write a query to display to 10 max record from the employee table?..

Answer / madhusudhan

select rownum rn,(select e.* from emp e)
order by sal desc
where rn>=&rn;

Is This Answer Correct ?    1 Yes 0 No

write a query to display to 10 max record from the employee table?..

Answer / ram

select * from
(
select e.*,dense_rank() over(order by sal desc) rank from emp e
)
where rank<=&rank

Is This Answer Correct ?    0 Yes 0 No

write a query to display to 10 max record from the employee table?..

Answer / nasa

select *from emp where sal in(select max(sal) from emp where level<=10 connect by prior sal>sal group by level);


This query show the top 10 records based on the salary

Is This Answer Correct ?    0 Yes 0 No

write a query to display to 10 max record from the employee table?..

Answer / narender.v

select * from emp x where &n=(select count(distinct sal)
from emp y where x.sal<=y.sal)

it will prompt for the value give the values as 10 u will
get the output

Is This Answer Correct ?    2 Yes 6 No

write a query to display to 10 max record from the employee table?..

Answer / rajasivam.p

To find nth value

select salary from emp a where &n=(select count(distinct
salary) from emp b where a.empno<=b.empno);

to find max by nth value a.empno<=b.empno
to find min by nth value a.empno>=b.empno

OR

To find 10 max records

select * from (select * from emp order by salary desc) where
rownum<=&n;

Is This Answer Correct ?    0 Yes 4 No

write a query to display to 10 max record from the employee table?..

Answer / madhoo

select * from emp a
where (select count(distinct sal) from emp b where
a.sal<b.sal)=&n order by sal desc
/


this is the exact query........when there are duplicate
salaries are there also........

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More Cognos Interview Questions

Explain what is the difference between microstrategy and cognos reporting tool?

0 Answers  


what is a Galaxy Schema?

2 Answers   IBM,


What is a Query Subject?

0 Answers  


how you burst the reports? If you are bursted reports is not reached to destination how you identify?when you import data into catalog you have complex columns names.how do you change the name of those columns?

0 Answers   IBM,


Can i apply drill through on chart in report studio?

4 Answers   TCS,






What is the difference between Standard and Metrics folder?

0 Answers  


What is IQD?What is contained in IQD?

3 Answers   ABC, IBM, Infosys,


WHAT ARE THE TYPES OF LIST REPORTS?

4 Answers   Patni,


dumps needed ASAP for - C2020-180 Cognos IBM Certification

0 Answers   Aptech,


How to create a Left Outer Join in FM? Please explain.

2 Answers   Cisco,


What is difference between primary key and unique key constraints?

0 Answers  


Hi All, I have 1.6 years of experience in cognos in India. I always wanted to do a MS program to earn some money in US. But I think I am little late in taking the decision. As If I have to write my GRE it will be August or September of 2012 and will have to apply for fall 2013 as fall 2012 admissions are almost done now. So my concern is how will be my career do if my MS is at this stage,. i,.e. 3 years experience in Cognos and 2 years MS program in and again looking for job in U.S. Have I been too late in taking the call? I heard that MIS (Managing Information Systems) is having very good placements now. So guys, please advice me in taking the decision to have a good career and also in terms of earning money as I have few financial problems to solve (which I am hoping to solve when I get job in US after completion of my MS program). Thanks a lot friends. I really appreciate and thank one and all for their valuable comments in this site.

0 Answers  


Categories