Subject | Re: [ib-support] Select first row |
---|---|
Author | Ali Gokcen |
Post date | 2001-02-07T09:19:15Z |
Hi,
You can select Min(column) function to fetch first row from db.
Select min(ID), name from table mytable; ( if ID is indexed response
time will be shortest )
There is no special row limitation on cursor in IB, you can limit the rows
via where clause, functions.
but there is a ugly way to do it,
you can create a user-specific GENERATOR and use its value in where clause
as a record counter.
gen_id(mygenerator, - gen_id(mygenerator,0); // mygenerator = 0
Select ID,name from mytable where GEN_ID(mygenerator,1)<100;
Regards,
Ali
You can select Min(column) function to fetch first row from db.
Select min(ID), name from table mytable; ( if ID is indexed response
time will be shortest )
There is no special row limitation on cursor in IB, you can limit the rows
via where clause, functions.
but there is a ugly way to do it,
you can create a user-specific GENERATOR and use its value in where clause
as a record counter.
gen_id(mygenerator, - gen_id(mygenerator,0); // mygenerator = 0
Select ID,name from mytable where GEN_ID(mygenerator,1)<100;
Regards,
Ali
----- Original Message -----
From: Don Schoeman
To: ib-support@yahoogroups.com
Sent: Wednesday, February 07, 2001 10:47 AM
Subject: [ib-support] Select first row
Hi,
I need to retrieve the first row of a table. Using Microsoft SQL Server 7.0,
this can be done with the following SET statement...
SET ROWCOUNT 1
SELECT * FROM EMPLOYEE
How do I do something similar with IB?
Best Regards,
Don Schoeman
__________________________________________________________________
Don Schoeman | Systems Engineer
Cellpoint SA (Pty) Ltd. | GSM data communication solutions
http://www.cellpt.co.za | http://www.cellpt.com
Yahoo! Groups Sponsor
www.
To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com