Thanks; this works fine:

select PLACE,
    sum(ID not in (select ID from ATTENDED)),
    count(ID)
 from PERSONS group by PLACE

But if I add the aliases I get:

near "All": syntax error
Result of sqlite3_prepare16_v3: 1
select PLACE, sum(ID not in (select ID from ATTENDED)) Not_Attended,
count(*) All from PERSONS group by PLACE

Otherwise very neat indeed though!

RBS



On Thu, Mar 14, 2019 at 12:21 AM Igor Tandetnik <i...@tandetnik.org> wrote:

> On 3/13/2019 8:08 PM, Bart Smissaert wrote:
> > But I would like the result to be in 3 columns, so result in this case
> > would be:
> >
> > Place Not_Attended All
> > -------------------------------
> > A       3                      7
> > B       2                      3
>
> Something like this (not tested):
>
> select PLACE,
>    sum(ID not in (select ID from ATTENDED)) Not_Attended,
>    count(*) All
> from PERSONS group by PLACE;
>
> --
> Igor Tandetnik
>
> _______________________________________________
> 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