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

Write a query to find five highest salaries from EMP table.
(there is a column SALARY)

Answer Posted / vivek dubey

this Query is wrong : " SELECT ENAME,SALARY FROM (SELECT ENAME,SAL FROM EMP ORDER BY SALARY DESC ) WHERE ROWNUM<6; " because We can not use Order by clause in SubQuery.

This Answer gives you the right data :

"
SELECT TOP 5
empsal.ENAME,
empsal.SAL
FROM
(
SELECT ENAME,SAL
FROM EMP
) AS empsal
ORDER BY empsal.SAL DESC
"

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we want to pass a parameter payroll_id to this external pl/sql function, how do we do it?

1020


Can we use ddl commands in pl sql?

1101


What is pl sql package?

1006


Can we group by two columns in sql?

951


What is a stored procedure in sql with example?

1071


what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba

965


How long will it take to learn pl sql?

909


What is trigger in pl sql with examples?

1000


What is oracle and pl sql?

1097


How are functions and procedures called in PL/SQL?

1153


Is primary key an index?

959


How can we optimize a sql query?

1003


What is the maximum rows in csv?

883


what is a record in a database ? : Sql dba

1024


Why do we use %rowtype & %type in plsql?

1003