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...


select the 3rd maximum salary from sql server database if 4
(just an example In practically I may not know the exact
situation) of the highest salaries are equal.

Answers were Sorted based on User's Feedback



select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / shekhar

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM tblSalary
ORDER BY salary DESC) S
ORDER BY salary

Is This Answer Correct ?    23 Yes 4 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / sumesh.s.g

--Sumesh.S.G--
SELECT TOP 1 salary
FROM (select top 3 Salary
from dbo.TBL_Employee
order by Salary desc) as TemTable order by Salary asc
--Happy coding--

Is This Answer Correct ?    2 Yes 0 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / jey ganesh

select min(sal) from employee where sal in(
select top 3 sal from employee order by sal desc)

Is This Answer Correct ?    2 Yes 1 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / kiran

select empid,salary
from (select distinct empid,salary,
Dense_Rank() over(order by salary desc) as Rank
from dbo.EmpSalary) b
where b.rank=3

Is This Answer Correct ?    1 Yes 1 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / sandeep saxena

CREATE procedure Proc_Loaddata_Text (@File_path nvarchar
(255),@Table_Name varchar(100)) AS

DECLARE @SQLString NVARCHAR(4000)

/* Build Command*/

SET @SQLString =N'Bulk Insert ['+@Table_Name+'] from ' +
N'N''' + @File_path + N''' with (FIELDTERMINATOR=''|'',
ROWTERMINATOR = ''\n'')'

--print @SQLString

/* Execute */

EXEC (@SQLString)
GO

Is This Answer Correct ?    0 Yes 1 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / vijay saxena

SELECT TOP 1 salary
FROM (
SELECT DISTINCT TOP 3 salary
FROM tblSalary
ORDER BY salary DESC)

Is This Answer Correct ?    0 Yes 2 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / sunil nair

SELECT EmpID,Salary from tblSalary a where 3=(select count
(distinct EmpID) from tblSalary b where b.empid>=a.empid)

For any database

Is This Answer Correct ?    2 Yes 5 No

select the 3rd maximum salary from sql server database if 4 (just an example In practically I may n..

Answer / sunil nair

SELECT EmpID,Salary from tblSalary a where 3=(select count
(EmpID) from tblSalary b where b.empid=a.empid)

for any RDBMS

Is This Answer Correct ?    2 Yes 13 No

Post New Answer

More SQL Server Interview Questions

what are defaults? : Sql server database administration

0 Answers  


Does view occupy space?

0 Answers  


How to create and drop temp table in sql server?

0 Answers  


When would you use sql joins?

0 Answers  


What does this statement do @@rowcount?

0 Answers  


Does order by actually change the order of the data in the tables or does it just change the output?

0 Answers  


how many clustered indexes can be created on a table? : Sql server database administration

0 Answers  


Tell me what is log shipping?

0 Answers  


How do I view a script in sql server?

0 Answers  


Due to some maintenance being done, the sql server on a failover cluster needs to be brought down. How do you bring the sql server down?

0 Answers  


What is not null constraint?

0 Answers  


Does sql server 2000 full-text search support clustering?

0 Answers  


Categories