Count the number of articles in a category
SELECT
t.id AS id,
t.typeName AS typeName,
count( * ) AS num
FROM
articles a
LEFT JOIN articletype t ON a.typeID = t.id
WHERE
t.isShow
Count the number of articles in a category
SELECT
t.id AS id,
t.typeName AS typeName,
count( * ) AS num
FROM
articles a
LEFT JOIN articletype t ON a.typeID = t.id
WHERE
t.isShow