我想使用来自库mktplace_olap的查询中的ID到inventory_log中的DAYOFWEEK()函数。
问题是 mktplace_olap中有no 'id' column
我不想要加入这两个表。
SELECT DATEDIFF(ol.sof_shipped_at_date,ol.order_creation_date) as totDays,
/* DAYOFWEEK(ADDDATE(ol.order_creation_date,id)) as dayOfWeek*/count(*)
FROM dwa_olap_mktplace.mktplace_olap ol
WHERE did in (select il.id from mktplace_catalog.inventory_log il) and id <= DATEDIFF(ol.sof_shipped_at_date,ol.order_creation_date)
AND DAYOFWEEK(ADDDATE(ol.order_creation_date,did)) IN (1);