Answer Posted / selvaraj v, anna university co
Find the HIGHEST SALARY in Employee Table :
-------------------------------------------
select * from emp where sal=(select max(sal) from emp)
order by empno;
Find the 3'rd HIGHEST SALARY in Emp Table :
-----------------------------------------------
SELECT * FROM EMP e WHERE 3=(SELECT COUNT(*) FROM EMP x
WHERE x.SAL>=E.SAL);
It's e,x are ALIAS NAME of EMP Table.
| Is This Answer Correct ? | 14 Yes | 2 No |
Post New Answer View All Answers
Why do we need view in sql?
What is sql partition function?
How many sql commands are there?
How you can copy a file to file content and file to pl/sql table in advance pl/sql?
Write an sql query to select all records from the table?
How can I tell if sql is running?
Which is better join or inner query?
How to revise and re-run the last sql command?
what is a scheduled jobs or what is a scheduled tasks? : Sql dba
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
Why do we need pl sql?
How to add new employee details in an employee_details table with the following details
How to return multiple rows from the stored procedure?
Explain lock escalation? : Transact sql
What is pl/sql table? Why is it used?