Subject | RE: [firebird-support] SELECT FIRST & COUNT |
---|---|
Author | Alexandre Benson Smith |
Post date | 2004-04-12T15:57:53Z |
At 17:24 12/04/2004 +0200, you wrote:
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]
>Stupid me. The FIRST argument ofcourse works as it should. The FIRSTHi Svend !
>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
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]