SELECT template_id FROM Documents GROUP BY template_id HAVING count(*)  >  1
Show ids for all templates that are used by more than one document.
SELECT template_id FROM Documents GROUP BY template_id HAVING count ( * ) > 1
select template_id from documents group by template_id having count ( * ) > value
Show ids for all templates that are used by more than one document .