MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 23rd, 2004, 10:57 AM
rksubbu rksubbu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Jacksonville, FL
Posts: 91 rksubbu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 59 sec
Reputation Power: 6
Question get rows between x and y

I am trying to write a query that will return rows between two specified numbers.

Top does not return results between x and y.

I searched in a lot of places without any luck. Is there not a sql statement to simply return rows between x and y.

example:
Select distinct
<syntax i dont know> top 50, 100 </syntax i dont know>
company, employee
from company;

Thanks.

Reply With Quote
  #2  
Old March 1st, 2004, 05:43 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
should you use a Where clause for this?
or are you trying to get all the rows between row 50 and row 100?
but why, I don't understand...are you trying to do paging manually?


try to explain what you result should look like, I might be able to help you then

Reply With Quote
  #3  
Old March 1st, 2004, 08:03 PM
rksubbu rksubbu is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Location: Jacksonville, FL
Posts: 91 rksubbu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 59 sec
Reputation Power: 6
Quote:
Originally Posted by sypher
should you use a Where clause for this?
or are you trying to get all the rows between row 50 and row 100?
but why, I don't understand...are you trying to do paging manually?


try to explain what you result should look like, I might be able to help you then


Yes, I am trying to do paging. I would like the users to see records in limits of 15 or 25, with next and previous buttons.

Reply With Quote
  #4  
Old March 1st, 2004, 08:20 PM
sypher sypher is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Location: Montreal
Posts: 92 sypher User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 10 sec
Reputation Power: 5
well...depends on your system...I know ASP.net does it...but not SQL directly...but your can do it manually with a primarey ...it's tricking but you can do it...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > get rows between x and y


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT