mysql如果updatedate is null就把createdate设置到updatedate
mysql> select * from e_task3instance_struct_8 where updatedate is null;
+---------------------+----------------+--------------------+------------------+----------+--------------+----------+-----------+--------------------+----------+-------+------------+-------------+----------+------------+--------+---------------------+-------------+------------+------------+---------+-------------+-------------+--------------+-----------+-----------+------------+----------+-------------+
| struct_id | task_code | instance_code | case_code | case_ver | plan_code | plan_ver | order_num | plan_casever_guid | comments | score | fail_cycle | total_cycle | attended | unattended | result | createdate | createuser | updatedate | updateuser | obsflag | comments_tl | is_template | task_version | blocktype | customatt | customuatt | runcycle | is_atc_test |
+---------------------+----------------+--------------------+------------------+----------+--------------+----------+-----------+--------------------+----------+-------+------------+-------------+----------+------------+--------+---------------------+-------------+------------+------------+---------+-------------+-------------+--------------+-----------+-----------+------------+----------+-------------+
| INSCT3-000003703362 | TASK0000015152 | INSTANCE0000077174 | NCAS2-0000323988 | 1 | PLN300000475 | 9 | 25 | CHDGUD000000046878 | | | NULL | NULL | 0 | 0 | 0 | 2024-12-11 12:05:15 | Manchen_Zhu | NULL | 2000 | 0 | NULL | 3 | 1 | [] | NULL | NULL | 1 | 0 |
+---------------------+----------------+--------------------+------------------+----------+--------------+----------+-----------+--------------------+----------+-------+------------+-------------+----------+------------+--------+---------------------+-------------+------------+------------+---------+-------------+-------------+--------------+-----------+-----------+------------+----------+-------------+
1 row in set (2.35 sec)
mysql> UPDATE e_task3instance_struct_8 SET updatedate = IF(updatedate IS NULL, createdate, updatedate);
Query OK, 1 row affected (0.40 sec)
Rows matched: 214457 Changed: 1 Warnings: 0
mysql> select * from e_task3instance_struct_8 where updatedate is null;
Empty set (0.23 sec)
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报