insert into test表名(md5id,tname) select DISTINCT md5id,tname from (
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'beee9d1bd4e7e507c5750da55e7f9c215f5249292' as md5id,'C' as tname
union all
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'e4bd629300c5e52c36abf380024035585f39802d1' as md5id,'E' as tname
) t where not exists( select 1 from test表名 where md5id=t.md5id )
insert into test表名(md5id,tname) select * from (
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'beee9d1bd4e7e507c5750da55e7f9c215f5249292' as md5id,'C' as tname
union all
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'e4bd629300c5e52c36abf380024035585f39802d1' as md5id,'E' as tname
) t where not exists( select 1 from test表名 where md5id=t.md5id )
insert into test表名(md5id,tname) select * from (
select 'e4bd629300c5ed376d8bdab5c94e0f5fea33bcf5e' as md5id,'A' as tname
union all
select 'e4bd629300c5198bd05dacd2fea6503bbdf91b0d5' as md5id,'B' as tname
union all
select 'beee9d1bd4e7e507c5750da55e7f9c215f5249292' as md5id,'C' as tname
union all
select 'e4bd629300c59df21ae6043bf8a5be8803bb4d31a' as md5id,'D' as tname
union all
select 'e4bd629300c5e52c36abf380024035585f39802d1' as md5id,'E' as tname
) t where not exists( select 1 from test表名 where md5id=t.md5id )