ms sql is TOP, 

SELECT TOP 50 * FROM Table

mysql is limit..
SELECT * FROM Table LIMIT 50,100
returns rows 50 to 100.

Travis

---- Original Message ----
From: "McAuliffe, Kreighan" <[EMAIL PROTECTED]>
Sent: 2001-10-15 15:12:40.0
To: JRun-Talk <[EMAIL PROTECTED]>
Subject: RE: SQL

Check out the "set rowcount" command in the SQL documentation for the
database you are using.  For example:

set rowcount 1
select columnName from tableName... (optional where clause as appropriate)
set rowcount 0

This should cause the database engine to return only one row when the query
is executed, then turn off the row restriction afterwards (else all
subsequent queries will return only one row.)

For MS SQL, you might also be able to use "select TOP ...."  Or, in worst
case, you could resort to using a cursor.



-----Original Message-----
From: Gregory Price [mailto:[EMAIL PROTECTED]]
Sent: Monday, October 15, 2001 10:29 AM
To: JRun-Talk
Subject: OT: SQL


does anyone know how to get a single row in a select statement in sql
say I want to grab the 5th row in some table regardless of its contense, 
i just want the 5th record
any help is appreciated!
Thanks
Greg Price



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to