On Thu, May 24, 2012 at 1:22 PM, Mike King <[email protected]> wrote:
> Is this Select statement valid? In Oracle, it wouldn't be because
> what is the aggregate of A. Is this behavior defined anywhere?
>
> create table T (A,B);
> insert into T (A,B) values (1,3);
> insert into T (A,B) values (2,3);
>
> select A,B
> from T
> group by B;
>
This is equivalent to the PostgreSQL:
SELECT DISTINCT ON(b) a,b FROM t;
There have been numerous complaints about the syntax and the fact that it
does not generate an error like Oracle, but there are also many legacy
applications that depend on this behavior. So we cannot change it without
breaking applications and causing general grief and woe amongst developers.
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
--
D. Richard Hipp
[email protected]
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users