C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Training   ASP.NET Web Hosting    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

Play Silverlight Games or Submit your Silverlight applications and earn 90% AdSense revenue.

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Forums » .NET » SQL Server »

Use of TOP keyword


Posted Date: 30 Nov 2008      Posted By: Sanjay Pal      Member Level: Silver     Points: 1   Responses: 4



I have a table having 100 records
now i wants to retieve records between top 5 to 15 .





Responses

Author: Arun Jacob    30 Nov 2008Member Level: GoldRating:     Points: 3


Select * from
(Select *,ROW_NUMBER() OVER(ORDER BY EmployeeID) as RowNumber from Employee)Temp
where RowNumber BETWEEN 2 AND 4


:-)

Arun Jacob
http://codenet.co.nr/



Author: Deepika Haridas    30 Nov 2008Member Level: DiamondRating:     Points: 3

Hi,
Select TOP 10 * from(Select *,ROW_NUMBER() OVER(ORDER BY EmployeeID) as RowNumber from Employee)Tempwhere RowNumber BETWEEN 2 AND 4

Regards,
deepika

++++
Thanks & Regards,
Deepika Haridas
DNS MVM

Please Rate this Response if you found it useful

Blog - www.angeldeeps.blogspot.com
Community - www.dotnetspider.com/sites/303/-TECHIE-QUESTIONNAIRE.aspx



Author: Roopesh Babu Valluru    01 Dec 2008Member Level: GoldRating:     Points: 3

Hi Friend..


This wil help u i think...
select top 10 * from tablename where primarykeycolumn not in (select top 5 primarykeycolumn from tablename)

All The Best..



Author: sonali chougule    01 Dec 2008Member Level: SilverRating:     Points: 1

select top 15 col1 from table1
where
col1 not in(
select top 5 col1 from table1)



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Sql query
Previous : SQL server 2008
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use