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 replication with database mirroring? : sql server database administration
What does it mean to invest in the index?
What is the difference between NOROW and LOCKROW?
0 Answers Accenture, Honeywell, Satyam,
What are the different types of joins and what does each do?
Explain full-text query in sql server?
What is store procedure?
What is msdb database? : SQL Server Architecture
What are the database roles? : sql server security
Why main is user defined function?
What is the difference between local table and global table
1 Answers CarrizalSoft Technologies, Polaris,
What are the essential components of sql server service broker?
How to create a ddl trigger using "create trigger" statements?
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)