Hi!

I have a weird result of sum(length()).  have a table called files and a 
column called name.

sqlite> select count(name) from files;
2840491
sqlite> select count(distinct name) from files;
890373

As you see there are files with the same name.

I want to sum the length of the names:

sqlite> select sum(length(name)) from files;
39429686
sqlite> select sum(length(distinct name)) from files;
39429686

I get the same result.

Looking at the generated vm opcodes for this query, the interpreter generates 
the same code for both.

If you select count(name) of the column, the difference seems to be that when 
you select count (distinct name) there is an extra instruction:

2|OpenEphemeral|1|0|keyinfo(1,BINARY)

Any clues?
regards
Duncan

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to