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 |
Does index slows down insert statements?
What r sql reporting services and analysis services? how can we use it.
What is the difference between having and where clause?
Where are magic tables stored ? Is it in the same database where it is created ?
Explain what are db_options used for?
Explain different types of lock modes in sql server 2000?
What are sql server procedures?
What is table level trigger?
What are distributed partitioned views?
What is the use of toad or sqldbx.?
SQL Server Performance Tuning for Stored Procedures & reducing debugging time?
1 Answers CarrizalSoft Technologies,
How to create function without parameter in sql server?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)