mysql中如何不重复插入,mysql 重复的不插入,mysql唯一的插入

 INSERT INTO new_schedules_spider_shipsname ( ID,SCAC,VESSEL,VOYAGE,SERVICE_NAME,MD5 ) SELECT
NULL,%s,%s,%s,%s,%s
FROM
DUAL
WHERE
NOT EXISTS ( SELECT * FROM new_schedules_spider_shipsname s WHERE s.MD5 = %s and s.STATE =0 )
posted @ 2018-12-26 16:25  AngDH  阅读(359)  评论(0编辑  收藏  举报