ZCChow opened a new issue #6787: URL: https://github.com/apache/incubator-doris/issues/6787
### 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 14.13 ### What's Wrong?  使用now()查询报错 ### What You Expected? success ### How to Reproduce? _No response_ ### Anything Else? CREATE TABLE `header` ( `id` bigint(20) NULL COMMENT "", `warehouse_id` bigint(20) NOT NULL COMMENT "", `plan_status` tinyint(4) NOT NULL COMMENT "", `is_deleted` bigint(20) NOT NULL DEFAULT "0" COMMENT "", `update_time` datetime NULL COMMENT "更新时间" ) ENGINE=OLAP UNIQUE KEY(`id`, `warehouse_id`) COMMENT "OLAP" DISTRIBUTED BY HASH(`warehouse_id`) BUCKETS 16 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "V2" ); CREATE TABLE `detail` ( `id` bigint(20) NOT NULL COMMENT "", `warehouse_id` bigint(20) NOT NULL COMMENT "", `header_id` bigint(20) NOT NULL COMMENT "", `sku_id` bigint(20) NOT NULL COMMENT "", `forecast_qty` decimal(20, 3) NOT NULL DEFAULT "0.000" COMMENT "", `expect_qty` decimal(20, 3) NOT NULL DEFAULT "0.000" COMMENT "", `is_deleted` bigint(20) NOT NULL DEFAULT "0" COMMENT "" ) ENGINE=OLAP UNIQUE KEY(`id`, `warehouse_id`) COMMENT "OLAP" DISTRIBUTED BY HASH(`warehouse_id`) BUCKETS 16 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "V2" ); CREATE TABLE `demand` ( `id` bigint(20) NULL COMMENT "", `warehouse_id` bigint(20) NOT NULL COMMENT "", `plan_id` bigint(20) NOT NULL COMMENT "", `demand_id` bigint(20) NOT NULL COMMENT "" ) ENGINE=OLAP UNIQUE KEY(`id`, `warehouse_id`) COMMENT "OLAP" DISTRIBUTED BY HASH(`warehouse_id`) BUCKETS 16 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "V2" );CREATE TABLE `sku_warehouse` ( `id` bigint(20) NOT NULL COMMENT "", `warehouse_id` bigint(20) NOT NULL DEFAULT "0" COMMENT "", `sku_id` bigint(20) NOT NULL DEFAULT "0" COMMENT "", `version` bigint(20) NOT NULL DEFAULT "1" COMMENT "" ) ENGINE=OLAP UNIQUE KEY(`id`, `warehouse_id`) COMMENT "OLAP" DISTRIBUTED BY HASH(`warehouse_id`) BUCKETS 16 PROPERTIES ( "replication_num" = "3", "in_memory" = "false", "storage_format" = "V2" ); SELECT pph.warehouse_id , pph.expt_ship_date , ppd2.demand_id , pph.id plan_id , pph.plan_status , sum(ppd.forecast_qty) forecast_qty , sum(ppd.expect_qty) expect_qty FROM pro_plan_header pph INNER JOIN pro_plan_detail ppd ON pph.id = ppd.plan_header_id AND pph.warehouse_id = ppd.warehouse_id INNER JOIN md_sku_warehouse msw ON msw.warehouse_id = ppd.warehouse_id AND msw.sku_id = ppd.sku_id INNER JOIN pro_plan_demand ppd2 ON pph.id = ppd2.plan_id AND ppd2.warehouse_id = pph.warehouse_id WHERE pph.update_time >= '2021-09-30 00:00:00' AND pph.update_time <= NOW() AND pph.plan_status = 40 GROUP BY pph.id , pph.warehouse_id , pph.expt_ship_date , ppd2.demand_id , pph.plan_status; ### 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
