On Wed, Aug 14, 2013 at 6:59 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Wed, Aug 14, 2013 at 12:22 PM, Rob Golsteijn
> <rob.golste...@mapscape.eu>wrote:
>
> > create table test(name);
> > insert into test values (NULL);
> > insert into test values ('abc');
> >
> > select count(),
> >        NULLIF(name,'abc') AS name
> > from test
> > group by lower(name);
> >
>
> So the question is, should the "name" symbol in the GROUP BY clause refer
> to the original column name in the TEST table, or should it refer to the
> result column called "name".  SQLite version 3.7.15 picks the TEST table
> column.  Version 3.7.17 picks the result column.
>
> Anybody know which is correct?
>

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ...
SQL> create table test (name varchar2(64));
Table created.
SQL> insert into test values (NULL);
1 row created.
SQL> insert into test values ('abc');
1 row created.
SQL> select count(*), max(nullif(name, 'abc')) as name from test group by
lower(name);
  COUNT(*) NAME
---------- ----------------------------------------------------------------
         1
         1
 SQL> select count(*), nullif(lower(name), 'abc') as name from test group
by lower(name);
  COUNT(*) NAME
---------- ----------------------------------------------------------------
         1
         1

Not authoritative of course, but Oracle seems to agree with the previous
behavior. --DD
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to