On Mon, Jun 20, 2016 at 8:37 AM, Harmen de Jong - CoachR Group B.V. <
har...@coachr.com> wrote:

> I have a query with a subquery (using an aggregate function) in the SELECT
> statement. Will this subquery be executed before or after the GROUP BY?
> For example:
> SELECT a.id, (SELECT max(orderno) FROM b WHERE b.c_id=c.id) as maxorderno
> FROM a INNER JOIN c on c.a_id=a.id
> GROUP BY a.id
>
>
that parens would suggest that the subs-slect is executed first. before
anything else...
but the reamining select also happens before the group by; it would never
be AFTER the group by, unless the group by was on the subselect, then it
would run between some of the select.s


Best regards,
> Harmen
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to