diff --git a/rslib/src/storage/notetype/get_use_counts.sql b/rslib/src/storage/notetype/get_use_counts.sql index cc667ce4d..dce0bdca1 100644 --- a/rslib/src/storage/notetype/get_use_counts.sql +++ b/rslib/src/storage/notetype/get_use_counts.sql @@ -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 \ No newline at end of file + nt.name \ No newline at end of file