Show ids for all templates that are used by more than one document.
create table documents (template_id varchar, PRIMARY KEY (template_id))
select template_id from documents group by template_id having count(*) > 1