错误代码:1054'IN / ALL / ANY子查询'中的未知列'id'

时间:2015-10-23 06:20:43

标签: mysql

我想使用来自库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);

0 个答案:

没有答案