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 select nth record from a table?

Answers were Sorted based on User's Feedback



How to select nth record from a table?..

Answer / ravinder pawar

Hi Frnds,
Pravin's logic is correct. I am just modifying it little
bit.

Select Top 1 *
From (Select Top 5 *
from HumanResources.Employee
order by EmployeeID desc)as temp

---Note If we don't use temp we'll get error as mentioned
below:
Incorrect syntax near ')'.

Is This Answer Correct ?    0 Yes 2 No

How to select nth record from a table?..

Answer / pravin s. ahire

Select Top 1 *
From (Select Top N * from tablename order by
table.ColumnName desc)

-- where N = nth record

Is This Answer Correct ?    0 Yes 3 No

How to select nth record from a table?..

Answer / sajida

--For ex in dept table to select 5th record. Instead of
this you can use &n so that it can ask row number

select rnum, d.* from dept d, (select rownum rnum ,
deptno from dept ) e
where d.deptno = e.deptno and rnum = 5

Is This Answer Correct ?    5 Yes 10 No

Post New Answer

More SQL Server Interview Questions

How to create a simple table to test triggers in ms sql server?

0 Answers  


Explain use of expression builder.

0 Answers  


How to replace null values in expressions using isnull()?

0 Answers  


What are SQL Jobs, please mention the use of it and how to create them.

1 Answers   247Customer,


Explain index in sql server?

0 Answers  


What is delete query?

0 Answers  


What is a Join and explain its types?

0 Answers  


What is resource db in sql server?

0 Answers  


what is macro?

5 Answers   Excel, Global Innovation, Wipro,


What are the benefits of filtered indexes?

0 Answers  


Explain active/passive and active/active cluster configurations?

0 Answers  


How we create SQL Server 2005 Reporting Services ? Give me Sample

0 Answers   HCL,


Categories