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
What are the different operators available in sql?
What is pl sql and why it is used for?
Is sql procedural language?
What is loop in pl sql?
How to disable a trigger name update_salary?
Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10
What plvcmt and plvrb does in pl/sql?
List the different type of joins?
Explain constraints in sql?
what happens if null values are involved in expressions? : Sql dba
Explain unique key in sql.
what is clause? : Sql dba
How do you break a loop in pl sql?
Define concurrency control. : Transact sql
How do I add a primary key to a table?