to get the number of rows:
select count(*) from testtableint;
or the next on might be quicker:
select count(1) from testtableint;

How can you be sure that the first row contains the lowest rowid when doing:
"select rowid,..... from testtableint where rowid>2 limit 1"
Would you need to do:
"select rowid,..... from testtableint where rowid>2 order by rowid limit 1"
or does sqlite order on rowid by default ?

At 23:15 1-1-2004 +0100, [EMAIL PROTECTED] wrote:
>
> Is it really much quicker than:
> select min(rowid) from testtableint having rowid>2;
> and is there a way to show the time a query takes to execute ?

I guess this what you mean:
select min(rowid) from testtableint where rowid>2
because having can only be used together with "group by"

I think it is not that fast because it has to do aggregate-functions, which mean an
extra overhead, and extra above this fact, it is impossible to retrieve other fields
when doing an aggregate, which means two queries have to be executed to get
the compleet row.


But now we are here, is there a way to retrieve the number of rows a table has
without getting all the rows?


thanks in advance

Bert Verhees



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to