how to retrive only second row from table in sql server
2000?
Answers were Sorted based on User's Feedback
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 |
Answer / madhuparna
select top 1 * from (select top 2 * from employee)A
Is This Answer Correct ? | 0 Yes | 0 No |
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 |
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 |
what is cursor?why we will go to cursor?advantages &disadvantages of cursors?
What happens when converting big values to numeric data types?
What does the automatic recovery do?
How the data stores in a page?
What is the process of normalising?
How would you use user_constraints table in DB?
WHICH INDEX IS FAST CLUSTER AND NON CLUSTER INDEX
4 Answers CarrizalSoft Technologies, L&T,
What is 2nf example?
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?
explain databases and sql server databases architecture? : Sql server database administration
What is the use of MOVE keyword in restore command
HOW TO RENAME A COLUMN NAME