INSERT INTO table_name
(create_time, update_time, name, latest_time)
VALUES (
NOW(),
NOW(),
'name'
'2023-04-25 19:05:50'
)
ON CONFLICT (name) DO UPDATE
SET update_time=NOW(),
target_name='name',
latest_time='2023-04-25 19:05:50',
重复什么也不做
INSERT INTO table_name
(create_time, update_time, name, latest_time)
VALUES (
NOW(),
NOW(),
'name'
'2023-04-25 19:05:50'
)
ON CONFLICT (name) DO NOTHING,