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
mid,
(
select
name
from notetypes nt
where
nt.id = mid
) as name,
count(id)
from notes
nt.id,
nt.name,
count(n.id)
from notetypes nt
left join notes n on (n.mid = nt.id)
group by
mid
nt.id
order by
name
nt.name