Write a query to get all details of employee who has maximum
salary from employee table

Answer Posted / sureshramsing

select * from emp where (empno,1)=(select * from(select empno,row_number() over(order by sal desc) rn from emp) where rn=1);

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of subscriptions in SQL Server replication?

554


What is CTE in SQL

542


Why should you use or avoid select * statements?

578


Explain how long are locks retained within the repeatable_read and serializable isolation levels, during a read operation with row-level locking?

660


Why are you getting errors when creating a new odbc dsn?

591






Explain what are the restrictions that views have to follow? : SQL Server Architecture

597


If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?

670


What is row_number () and partition by in sql server?

523


Why does sql studio use a single registered database repository? : sql server management studio

534


Does transparent data encryption provide encryption when transmitting data across the network?

630


What is the difference between composite index and covering index?

513


What are the differences between stored procedure and view in sql server?

627


Why use stored procedures in sql server?

554


Can I disable or restrict ssrs export formats (rendering formats)?

108


Tell me about normalization in DBMS.

583