The only query I've seen to do this is in the form
SELECT * FROM MyTable A
WHERE 50 > (SELECT COUNT(B.TableID) FROM MyTable B
WHERE A.TableID < B.TableID)
a. I don't know if local SQL will do it - it's pretty good now though.
b. It kills DBMS's - ie a stored proc, on a SQL db, or a cursor on pdx is
faster.
Warning: buy more ram, even at current prices, before attempting this.
Max
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Donovan J. Edye
Sent: Wednesday, 27 October 1999 19:56
To: Multiple recipients of list delphi
Subject: [DUG]: SQL Help....
G'Day,
Can anyone give me some SQL which will give me x records without using a
cursor. Say the first batch of 50 and then the next batch of 50
ie
SELECT * FROM TableName WHERE Count(*) <= 50
SELECT * FROM TableName WHERE Count(*) > 50 AND Count(*) <= 100 etc.
Assuming this can be done. Could it be done in a desktop DB such as Paradox
or would it have to be a MS SQL Server etc.
TIA
------------------------------------------------------------------------
--Donovan
Donovan J. Edye [www.edye.wattle.id.au]
Namadgi Systems, Delphi Developer
Web: www.namsys.com.au E-Mail: [EMAIL PROTECTED]
Voice: +61 2 6285-3460 Fax: +61 2 6285-3459
TVisualBasic := Class(None);
------------------------------------------------------------------------
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz