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)