mysql 插入数据 replace into 用法

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



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)

你可能感兴趣的:(项目总结)