Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 19th, 2004, 10:35 PM
Authorized User
 
Join Date: Mar 2004
Posts: 74
Thanks: 0
Thanked 0 Times in 0 Posts
Default 100 dollar worth question?

Let's say i have customer table where i have 1000's of records. If i want to retrive only first 10 rows from the customer table. HOW do i do that?

can any one write the code for me?

 
Old March 19th, 2004, 11:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 111
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You need to define "TOP 10", eg, the first 10 records entered, the first 10 alphabetically by name etc.

SELECT TOP 10 UserFirstName, UserSurname FROM myTable ORDER BY UserSurname

the "top 10" is the key - it selects the TOP 10 records that match the criteria.

Cheers
Ken

Microsoft MVP - Windows Server (IIS)
www.adOpenStatic.com
 
Old March 21st, 2004, 05:37 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Note: This requires using a database system that supports the TOP keyword.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it worth have sperate data and business layers hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 August 12th, 2005 04:35 AM
Is it worth the price? Spivonious C# 4 August 11th, 2004 03:32 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.