hf200012 opened a new issue, #9662: URL: https://github.com/apache/incubator-doris/issues/9662
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues. ### Version 1.0 ### What's Wrong? create table statement: ``` CREATE TABLE IF NOT EXISTS expamle ( `user_id` LARGEINT NOT NULL COMMENT "用户id", `username` VARCHAR(50) NOT NULL COMMENT "用户昵称", `city` VARCHAR(20) COMMENT "用户所在城市", `age` SMALLINT COMMENT "用户年龄", `sex` TINYINT COMMENT "用户性别", `phone` LARGEINT COMMENT "用户电话", `address` VARCHAR(500) COMMENT "用户地址", `effect_date` DATE COMMENT "用户注册时间", `create_time` DATETIME COMMENT "用户注册时间" ) UNIQUE KEY(`user_id`, `username`) DISTRIBUTED BY HASH(`user_id`) BUCKETS 1 PROPERTIES ( "replication_allocation" = "tag.location.default: 1" ); ``` insert : ``` INSERT INTO `expamle` VALUES ('10000','zhangfeng1','北京',20,0,'13347420869','test_123_234_446',NULL,'2017-10-01 07:00:00'),('10001','zhangfeng2','北京',30,1,'13347420869','test_123_234_446','2022-05-18','2017-10-01 17:05:45'),('10002','zhangfeng3','上海',20,1,'13347420869','test_123_234_446','2022-05-18','2017-10-02 12:59:12'),('10003','zhangfeng4','广州',32,0,'13347420869','test_123_234_446','2022-05-18','2017-10-02 11:20:00'),('10004','zhangfeng5','深圳',35,0,'13347420869','test_123_234_446','2022-05-18','2017-10-01 10:00:15'),('10004','zhangfeng6','深圳',35,0,'13347420869','test_123_234_446','2022-05-18','2017-10-03 10:20:22'); ``` ``` mysql> select if(effect_date is null,create_time,effect_date) from expamle limit 11; +---------------------------------------------------------+ | if(`effect_date` IS NULL, `create_time`, `effect_date`) | +---------------------------------------------------------+ | 20171001070000 | | 20220518 | | 20220518 | | 20220518 | | 20220518 | | 20220518 | +---------------------------------------------------------+ 6 rows in set (0.01 sec) mysql> select create_time,effect_date from expamle; +---------------------+-------------+ | create_time | effect_date | +---------------------+-------------+ | 2017-10-01 07:00:00 | NULL | | 2017-10-01 17:05:45 | 2022-05-18 | | 2017-10-02 12:59:12 | 2022-05-18 | | 2017-10-02 11:20:00 | 2022-05-18 | | 2017-10-01 10:00:15 | 2022-05-18 | | 2017-10-03 10:20:22 | 2022-05-18 | +---------------------+-------------+ 6 rows in set (0.03 sec) ``` ### What You Expected? Expected output date should be yyyy-mm-dd or yyyy-mm-dd HH:mm:ss ### How to Reproduce? _No response_ ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org