On 11/24/2018 8:51 PM, Bart Smissaert wrote:
Ok, in the first count column I would like the grouped counts for patients
in the views on_non_insulin or on_insulin and
in the second count column I would like the grouped counts for patients the
view diabetics.

Well, you already know the technique for this.

select gp_name,
  sum(emis_number in (select emis_number from diabetics),
  sum(emis_number in (select emis_number from on_non_insulin) OR
           emis_number in (select emis_number from on_insulin))
from patients group by gp_name;

--
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to