How do i display only the first few records in a recordset... no paging

How do I display only the first few records in a recordset. I don't
want paging. I just want to list the last few additions to a database
and thats it. Is there a simple way?
ryangrayson [ Sa, 15 Juli 2006 04:44 ] [ ID #1392479 ]

Re: How do i display only the first few records in a recordset... no paging

ryangrayson [at] gmail.com wrote:
> How do I display only the first few records in a recordset. I don't
> want paging. I just want to list the last few additions to a database
> and thats it. Is there a simple way?

SELECT TOP n <field1>, <field2>, <fieldn> FROM <table> ORDER BY
<field3> DESC

The first n is the number of records you want to select. <field3> is a
field that defines the order in which the records appear - usually an
incremented ID field.

--
Mike Brind
Mike Brind [ Sa, 15 Juli 2006 10:00 ] [ ID #1392480 ]
Webserver » microsoft.public.inetserver.asp.db » How do i display only the first few records in a recordset... no paging

Vorheriges Thema: Moving to a previous record
Nächstes Thema: large varchar columns in SQL server