How to select nth record from a table?

Answer Posted / mohan krishna

declare @querry nvarchar(500)
declare @row varchar(10)
set @row = '5'

set @querry ='
select top 1 a.* from
(select * from vdpmaster..usermaster
where usr_id not in
(select top '
set @querry = @querry + @row + ' usr_id from
vdpmaster..usermaster)
)a'
print @querry
EXEC sp_executesql @querry

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain intellisense for query editing

667


whats new about truncate in sql server 2008?

2127


What are joins in sql and what are the different types of joins?

628


How do I view views in sql server?

601


What is sql server locking?

619






What are the difference between “where” and “having” clause in sql server?

662


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

591


Why can there be only one clustered index and not more than one?

625


Can I delete event logs?

618


What are the properties of sub-query?

677


What is normalization process?

685


How to override dml statements with triggers?

653


State the difference between local and global temporary tables?

688


How many types of triggers in sql server?

612


Explain try...catch with sql server?

677