macromedia.coldfusion.database_access
[Top] [All Lists]

Re: Select in SQL server

Subject: Re: Select in SQL server
From: "paross1" <webforumsuser@xxxxxxxxxxxxxx>
Date: Wed, 30 Jul 2008 15:33:58 +0000 (UTC)
Newsgroups: macromedia.coldfusion.database_access

SQL Server BOL is your friend.....

 [i]The TOP clause limits the number of rows returned in the result set.

 TOP n [PERCENT]

 n specifies how many rows are returned. If PERCENT is not specified, n is the 
number of rows to return. If PERCENT is specified, n is the percentage of the 
result set rows to return:

 TOP 120 /*Return the top 120 rows of the result set. */
 TOP 15 PERCENT /* Return the top 15% of the result set. */.

 If a SELECT statement that includes TOP also has an ORDER BY clause, the rows 
to be returned are selected from the ordered result set. The entire result set 
is built in the specified order and the top n rows in the ordered result set 
are returned.[/i]

 Phil




<Prev in Thread] Current Thread [Next in Thread>