Subject RE: [firebird-support] SELECT FIRST & COUNT
Author Alexandre Benson Smith
At 17:24 12/04/2004 +0200, you wrote:

>Stupid me. The FIRST argument ofcourse works as it should. The FIRST
>argument always limits the number of rows returned, but in this case only
>one row is returned in any case. "SELECT FIRST 0 COUNT(*) FROM TestTable"
>does have an effect.....
>
>But anyway. Is there any way to limit the number of records counted?
>
>-
>SMN

Hi Svend !

There is no way to stop a count when it reachs some limit.

What about write a "MinOf" UDF to do this ?

Select
MinOf(count(*), 2000)
from
MyTable


Just to show what I think of, this is NOT the correct sintax to write UDF's
in Pascal

function MinOf(Value1, Value2:Integer):Integer;
begin
if Value1 < Value2 then
Result := Value1
else
Result := Value2
end;

HTH



Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br

----------


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.654 / Virus Database: 419 - Release Date: 06/04/2004


[Non-text portions of this message have been removed]