Alexander Gattin <xr...@umc.com.ua> writes:

> On Fri, Nov 19, 2010 at 12:32:19PM +0100, Alain
> Ketterlin wrote:
>> Alexander Gattin <xr...@yandex.ru> writes:
>> > 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.
>
> I'm using count(1), which is a count over constant
> non-NULL expression (1). It doesn't ignore NULLs
> or duplicate rows, as my attempts with Oracle 10g,
> 8g and sqlite3 show.

I'm not saying anything about count(1) (which works like count(*) as you
explain, even though I see no point in using 1, since *'s hehavior is
well-defined).

What was wrong in your first message is that count(*) ignores NULL
(granted, you've corrected your mistake in a later message, which I
didn't see before posting).

-- Alain.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to