下面的查询是在连接到Mongodb后通过Tableau Custom SQL执行的。 看起来像WHERE语句中的日期字段函数给出了错误消息。
这是错误消息:
[Simba] [MongoDBODBC](110)来自MongoDB客户端的错误:无法读取4 来自套接字的字节在300000毫秒内。 (错误代码:4)
我想在过去3个月内根据以下字段提取数据。
SELECT
"orders_transitions"."CHILD" AS "CHILD",
"orders_transitions"."PARENT" AS "PARENT",
"orders_transitions"."Start_Time" AS "Start_Time",
"orders_transitions"."Order_Date" AS "Order_Date",
COUNT("orders_transitions"."ORDER_ID") AS "cnt_ORDER_ID_ok"
FROM "orders_transitions"
WHERE "orders_transitions"."Order_Date" > CAST('4/01/2016 11:00:00 AM') AS Date
GROUP BY 1, 2, 3, 4