On Thu, May 28, 2009 at 04:30:14PM +0200, Ralf Junker wrote:
>   select
>     (select count(*) from t t_inner
>      group by t_outer.c)             -- t_outer !!!
>   from t t_outer;
> 
>   select
>     (select count(*) from t t_inner
>      group by t_inner.c)             -- t_inner !!!
>   from t t_outer;
> 
> The SQLite help [1] says: "The expressions in the GROUP BY clause do
> not have to be expressions that appear in the result." Reading this,
> I'd expect that both queries should run - even if the 1st one does not
> make much sense. Opinions?

"do not have to be expressions that appear in the result" != "do not
have to be expressions that appear in the query".  The first relates to
expressions appearing to the left of WHERE and the seconds relates to
expressions appearing to the right of WHERE.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to