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 enforce security in sql server? : sql server security

0 Answers  


What is the minimum and maximum number of partitions required for a measure group? : sql server analysis services, ssas

0 Answers  


Explain contrast amongst grouped and non-bunched records?

0 Answers  


What is difference between sql and sql server?

0 Answers  


When you first load SQL SERVER you will startup with what all databases?

3 Answers   CompuSol,


What is database isolation in sql server? : sql server database administration

0 Answers  


How to update values in a table with update statements in ms sql server?

0 Answers  


How to recreate an existing index in ms sql server?

0 Answers  


What is not null constraint?

0 Answers  


How to create a view and a stored procedure in ms sql server using "create view/procedure" statements?

0 Answers  


How to delete duplicate rows?

0 Answers  


How to rebuild indexes with alter index ... Rebuild?

0 Answers  


Categories