fix use counts not including unused note types

This commit is contained in:
Damien Elmes 2020-04-24 19:17:35 +10:00
parent a181d9aa02
commit 87cd119216

View file

@ -1,15 +1,10 @@
select select
mid, nt.id,
( nt.name,
select count(n.id)
name from notetypes nt
from notetypes nt left join notes n on (n.mid = nt.id)
where
nt.id = mid
) as name,
count(id)
from notes
group by group by
mid nt.id
order by order by
name nt.name