On 12 Oct 2011, at 3:54pm, Petite Abeille wrote:

> On Oct 12, 2011, at 4:45 PM, Simon Slavin wrote:
> 
>> You didn't define the columns as text columns, so SQLite doesn't understand 
>> that 'T' is anything like 't'.
> 
> Hmmm...?!?!? 

Sorry, I messed up and INSERTed the rows a second time and got different 
results.  My mistake.

However, along the way ...

sqlite> select a, case when b = 't' then 1 end, case when
   ...> b = 'T' then 1 end from t;
1|1|
1|1|
1||1
2|1|
2||1
2||1
sqlite> select a, case when b = 't' then 1 end, case when
   ...> b = 'T' then 2 end from t;
1|1|
1|1|
1||2
2|1|
2||2
2||2

Was that not what you were expecting ?  You are using count(2) not sum(2).

Simon.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to