mysql 插入数据 replace into 用法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/weixin_35756522/article/details/80351891

https://blog.csdn.net/wjc19911118/article/details/12152645

<!--3-26 同步库 -->
<insert id="insertLabelWarning">
REPLACE INTO hs_label_warning (
label_code,
is_warning,
label_status,
is_notice,
create_time,
update_time
) SELECT
label_code,
0 AS is_warning,
0 AS label_status,
0 AS is_notice,
now() AS create_time,
now() AS update_time
FROM
hs_label where label_code not in (select label_code from hs_label_warning and status =1)
</insert>

阅读更多

没有更多推荐了,返回首页