SQLite3 and lastrowid

Alain Ketterlin alain at dpt-info.u-strasbg.fr
Fri Nov 19 06:32:19 EST 2010


Alexander Gattin <xrgtn at yandex.ru> writes:

>> The proper way to get the number of rows is to
>> use the COUNT aggregate function, e.g., "SELECT
>> COUNT(*) FROM TABLE1", which will return a
>> single row with a single column containing the
>> number of rows in table1.
>
> It's better to select count(1) instead of
> count(*). The latter may skip rows consisting
> entirely of NULLs IIRC.

Wrong: count(anyname) ignores NULL, whereas count(*) does not.

-- Alain.



More information about the Python-list mailing list