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 the query for find the top 2 highest salary in sql
server

Answer Posted / raja.p

Find The 4 Top Salary in a Company
----------------------------------

CREATE TABLE EMPLOYEE2 (NAME VARCHAR2(20), SALARY NUMBER) ;

CREATE TABLE employee2 (
name char(20),
salary float);
INSERT INTO employee2 VALUES (
'Raja',
10000);
INSERT INTO employee2 VALUES (
'Arithas',
10000);
INSERT INTO employee2 VALUES (
'Balaji',
12000);
INSERT INTO employee2 VALUES (
'Vairam',
13000);
INSERT INTO employee2 VALUES (
'Muthu Krishnan',
14000);
INSERT INTO employee2 VALUES (
'Muthu Kumar',
15000);
INSERT INTO employee2 VALUES (
'Ramesh',
9000);

select e.name,e.salary from Employee2 e where 4>(select
count(Distinct
d.salary)from employee2 d where d.salary>e.salary) order by
e.salary desc;

Is This Answer Correct ?    16 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the different types of triggers in SQL SERVER?

1127


Can you edit the .rdl code associated with a linked report?

163


Explain for xml explicit mode?

970


Difference between LEN() and DATALENGTH() in sql server ?

1098


What is the syntax to execute the sys.dm_db_missing_index_details?

1019


Can we add an identity column to decimal datatype?

993


what are the basic functions for master, msdb, model, tempdb and resource system databases? : sql server database administration

985


List some advantages and disadvantages of stored procedure?

1014


How ssrs maintain security?

1084


What is data source view or dsv? : sql server analysis services, ssas

1000


What is data source document?

1032


Explain a differential backup?

1001


What is stored in the mssqlsystemresource database? : sql server database administration

1025


How would you go about developing a ssrs report?

166


Why I am getting "the microsoft .net framework 2.0 in not installed" message?

972