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

what is cursor?why we will go to cursor?advantages &disadvantages of cursors?

1 Answers  


What happens when converting big values to numeric data types?

0 Answers  


What does the automatic recovery do?

0 Answers  


How the data stores in a page?

1 Answers  


What is the process of normalising?

0 Answers  






How would you use user_constraints table in DB?

0 Answers   Wipro,


WHICH INDEX IS FAST CLUSTER AND NON CLUSTER INDEX

4 Answers   CarrizalSoft Technologies, L&T,


What is 2nf example?

0 Answers  


Is it possible to create a stored procedure that runs a query and outputs the results to a text file and allows me to add extra delimeters and static field info. If so How?

1 Answers  


explain databases and sql server databases architecture? : Sql server database administration

0 Answers  


What is the use of MOVE keyword in restore command

3 Answers   IBM,


HOW TO RENAME A COLUMN NAME

3 Answers  


Categories