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


how to retrive only second row from table in sql server
2000?

Answers were Sorted based on User's Feedback



how to retrive only second row from table in sql server 2000?..

Answer / ramana

Table Like this

Create Table Employee(Name varchar(20),Location
varchar(20),Salary int)

Query Like this

Select top 1 * from employee where Name not in(select top 1
Name from Employee)

it will display second record....

Is This Answer Correct ?    2 Yes 2 No

how to retrive only second row from table in sql server 2000?..

Answer / madhuparna

select top 1 * from (select top 2 * from employee)A

Is This Answer Correct ?    0 Yes 0 No

how to retrive only second row from table in sql server 2000?..

Answer / prabhat sharma

select top 1 * from xyz where rno > (select top 1 rno from xyz)

rno is a column name and xyz is a table name

Is This Answer Correct ?    0 Yes 0 No

how to retrive only second row from table in sql server 2000?..

Answer / jayaraman b

select min(emp_no) from
(select top 2 * from emp order by emp_no desc)A
--This will give you the 2nd largest Salaried employee

select max(emp_no) from
(select top 2 * from emp order by emp_no desc)A
--This will give you the 1st largest Salaried employee

Is This Answer Correct ?    0 Yes 0 No

how to retrive only second row from table in sql server 2000?..

Answer / ravi

select top 2 from tablename

Is This Answer Correct ?    6 Yes 28 No

Post New Answer

More SQL Server Interview Questions

1. SELECT SUM(sal) as “Gross Salary” from EMPLOYEES; 2. SELECT MAX(sal) as “Highest Salary” from EMPLOYEES; ouput should be in table format

2 Answers  


How to list all schemas in a database?

0 Answers  


How you would rewrite the sql query to return the customerid sorted numerically?

0 Answers  


What are the different types of replication you can set up in sql server?

0 Answers  


explain what is raid and what are different types of raid configurations? : Sql server database administration

0 Answers  


What is sub-query in sql server?

0 Answers  


What are views in ms sql server?

0 Answers  


What is the use of DBCC commands?

4 Answers   NA,


Define inner join in sql server joins?

0 Answers  


whats the maximum size of view state??

0 Answers  


how many triggers you can have on a table? : Sql server database administration

0 Answers  


what is nonclustered index

0 Answers  


Categories