Re: [sqlite] internal column header not case sensitive?

2011-10-13 Thread Nelson, Bjorn

On Oct 12, 2011, at 5:28 PM, Simon Slavin wrote:

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

I don't see why the result I am expecting would be different between count or 
sum.  I wasn't try to get the values, 1 or 2 just results in a unique 
difference but the counts should be different and they aren't.  With sum or 
count, the result would only show the first column in both resulting columns, 
and ignore that there were actually two unique columns, due to case sensitivity 
in the expression, even with a unique AS label.  I would think that it would at 
least see the AS label and use that as a reference point if we couldn't go with 
assuming that expressions as column headers are case sensitive.

This seems to be a bug.  Is there a way to submit this as a bug somewhere or is 
this the proper way for me to raise this to someone's attention that would be 
interested in fixing this?  Apologies for not understanding the bug submission 
process better.

-Bjorn

--
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers. If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] internal column header not case sensitive?

2011-10-12 Thread Nelson, Bjorn
I am having an issue where I build a query that creates columns based on case 
expressions.  The expressions are identical except for a case difference.  The 
result only shows data from the first expression duplicated in both columns.

The query that results in the issue:
select
  mycategory,
  count(case when type = 'typea' then 1 end) as 'test1',
  count(case when type = 'Typea' then 1 end) as 'test2'
from mytable
group by mycategory

Results in a table like this:
mycategory|test1|test2
cat1|500|500
cat2|350|350

But if I change it to:
select
  mycategory,
  count(case when type = 'typea' then 1 end) as 'test1',
  count(case when type = 'Typea' then 2 end) as 'test2'
from mytable
group by mycategory

Results in a table like this:
mycategory|test1|test2
cat1|500|200
cat2|350|150

It's as if, even though I specify an AS clause, it is representing the column 
header internally as the expression (ignoring the unique name I provided), and 
since columns are case insensitive then it just refers to the first column when 
printing it out.

Bjorn Nelson

--
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or 
views contained herein are not intended to be, and do not constitute, advice 
within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and 
Consumer Protection Act. If you have received this communication in error, 
please destroy all electronic and paper copies and notify the sender 
immediately. Mistransmission is not intended to waive confidentiality or 
privilege. Morgan Stanley reserves the right, to the extent permitted under 
applicable law, to monitor electronic communications. This message is subject 
to terms available at the following link: 
http://www.morganstanley.com/disclaimers. If you cannot access these links, 
please notify us by reply message and we will send the contents to you. By 
messaging with Morgan Stanley you consent to the foregoing.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users