GROUP BY works on your input data, not output data. You want to GROUP BY COALESCE(x.id, y.id)
On Thu, Sep 25, 2014 at 1:37 PM, Mark Lawrence <no...@null.net> wrote: > On Thu Sep 25, 2014 at 08:32:29PM +0200, Mark Lawrence wrote: > > GROUP BY on a result column fails with "ambiguous column name": > > > > SELECT > > COALESCE(x.id, y.id) AS id > > FROM > > y > > LEFT JOIN > > x > > ON > > x.id = y.fk > > ORDER BY > > id > > ; > > Sorry, that should read GROUP BY of course. > > -- > Mark Lawrence > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Cory Nelson http://int64.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users