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 is a file delimiter?
What are the two characteristics of a primary key?
Can we write ddl statements in functions?
What are sql commands?
Can we use distinct and group by together?
how to present a past time in hours, minutes and seconds? : Sql dba
What is an alias command?
what are date and time intervals? : Sql dba
What does where 1 1 mean in sql?
How to combine two stored procedures in sql?
What is a sql*loader control file?
what is a trigger? : Sql dba
What is partition by in sql?
what does it mean to have quoted_identifier on? What are the implications of having it off? : Sql dba
What is sql resultset?