How to SELECT first 'n' rows only from a table ?

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: sreckos (sreckos_at_discussions.microsoft.com)
Date: 09/21/04


Date: Tue, 21 Sep 2004 05:23:03 -0700

I would need to get first 'n' rows from a table with a Select statement,
where 'n' is a given number - a constant.
My Select contains WHERE and ORDER BY clause.

Working with MS SQL Server 2000 database.

How to construct such a Select?
Is this even possible?
Any advices?



Relevant Pages

  • Re: Row Order
    ... morphed into a flat-file design into SQL Server. ... Server is a relational database that assumes set operations and doesn't let ... > somebody doesn't want to have to add an ORDER BY clause to the cursor ...
    (microsoft.public.sqlserver.programming)
  • Re: Q
    ... It depends on the database. ... With SQL Server, all the filter conditions can ... there should be a WHERE clause for the ...
    (microsoft.public.inetserver.asp.db)
  • Re: Update failure on Sql Server 2008
    ... the logic bug is not really a logic bug. ... It add all the fields to the where clause for the sake of concurrency ... Microsoft SQL Server MVP ... We migrated our Sql Server 2000 database to Sql Server 2008 v 10.0.1600 ...
    (microsoft.public.sqlserver.server)
  • cannot get where clause to work
    ... I am fairly new to Perl and cannot get a where clause to work. ... The database is MS SQL Server 7. ... I tried placing % inside the single quotes when using LIKE. ...
    (perl.dbi.users)
  • cannot get where clause to work
    ... I am fairly new to Perl and cannot get a where clause to work. ... The database is MS SQL Server 7. ... I tried placing % inside the single quotes when using LIKE. ...
    (perl.dbi.users)