/* update titles_test set to_date=NULL,from_date='2001-01-01' where to_date='9999-01-01'; */ -- 自己写的 UPDATE titles_test SET to_date = CASE WHEN to_date = '9999-01-01' THEN NULL ELSE to_date END, from_date = '2001-01-01' WHERE to_date = '9999-01-01'; -- gpt写的