SunQuest
 
           ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingASP 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 ASP Free Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 13th, 2008, 10:31 AM
libor libor is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2006
Posts: 208 libor User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 2 h 43 m 42 sec
Reputation Power: 2
Database - General - How to get back first selected records from database ?

Hi,
how can I select for example first 10 selected records from database ?

thanks for your answers ..

Reply With Quote
  #2  
Old May 13th, 2008, 10:57 AM
mmltonge mmltonge is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 203 mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level)mmltonge User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Day 17 h 35 m
Reputation Power: 56
In access do "SELECT TOP 10 field, field2, field3 FROM tblTable"

In mySql do "SELECT field, field2, field3 FROM tblTable LIMIT 10"

To get bottom 10 do "ORDER BY idfield DESC" at end (before limit 10 for MySql)
Comments on this post
sync_or_swim agrees!

Reply With Quote
  #3  
Old May 14th, 2008, 05:11 AM
sync_or_swim's Avatar
sync_or_swim sync_or_swim is offline
Contributing User
Click here for more information.
 
Join Date: Mar 2006
Location: South Wales
Posts: 1,259 sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level)sync_or_swim User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 23 h 8 m 7 sec
Reputation Power: 769
Just for completeness (and because I'm an Oracle user!!), the equivalent in Oracle is to use rownum:
Code:
SELECT field, field2, field3 FROM tblTable WHERE rownum <= 10

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingASP Development > Database - General - How to get back first selected records from database ?


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 | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway