SunQuest
 
           MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 14th, 2003, 04:46 PM
PFerrara PFerrara is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 19 PFerrara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to PFerrara Send a message via AIM to PFerrara
MySQL's BETWEEN or similar

Alright, I need a script to load a certain number of rows from a table based on the ids (a field in the table). Basically, I want the script to load ids 500-600 for example. What would be the SQL to do so?

Last edited by PFerrara : October 14th, 2003 at 04:48 PM.

Reply With Quote
  #2  
Old October 14th, 2003, 04:51 PM
PFerrara PFerrara is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 19 PFerrara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to PFerrara Send a message via AIM to PFerrara
Nevermind, since its a static amound, if I just say select where id is >= to 500 limit 100 ill be fine

Reply With Quote
  #3  
Old October 14th, 2003, 06:20 PM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Actually you can use the BETWEEN syntax to achieve that...

select * from myTable where id BETWEEN 500 AND 600
__________________
The deal is not to know everything, but to know the email of the one who does.

Reply With Quote
  #4  
Old October 14th, 2003, 08:33 PM
PFerrara PFerrara is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 19 PFerrara User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to PFerrara Send a message via AIM to PFerrara
oh ok, thanks

I was also doing an id < number AND id >= number, works the same, thanks though

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > MySQL's BETWEEN or similar


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 6 hosted by Hostway