select tfd.tid, tfd.name as 'Name', IFNULL(map.sourceid1, '') AS 'Migrate Key', concat('https://www.durhamtech.edu/taxonomy/term/', tfd.tid, '/edit') AS 'URL'
from taxonomy_term_field_data tfd
inner join (
	select name, count(*) 
	from taxonomy_term_field_data 
	where vid = 'course' 
	group by name 
	having count(*) > 1
) dupes on dupes.name = tfd.name
left join migrate_map_course_data_taxonomy map on map.destid1  = tfd.tid
where tfd.vid = 'course' 
order by name, tid;

