The answer given by @bnvdarklord is right, but it will include filenames that also do not have extensions in the result set, so if you want only extension templates to use below the query.
SELECT DISTINCT substring_index(column_containing_file_names,'.',-1) FROM table where column_containing_file_names like '%.%';
source share