Exact Target使用MYSQL,但它阻止我使用SOME命令。要么等,我得到这个错误 "无法对包含聚合或子查询的表达式执行聚合函数。"
select tm.CustomerID as customerid, tp.Category1 as product_category, (SELECT RIGHT(tod.ProductCode,2)) as size, (SELECT count ((SELECT RIGHT(tod.ProductCode,2))) as unique_size_purchases FROM ent.customer_product_sizing_profile
GROUP by customerid)
from ENT.TAR_POS_CUSTOMER as tm
LEFT OUTER JOIN ENT.TAR_POS_ORDER_HEADER as th
ON tm.CustomerID=th.CustomerID
LEFT OUTER JOIN ENT.TAR_POS_ORDER_DETAILS as tod
ON tod.OrderNumber=th.OrderNumber
LEFT OUTER JOIN ENT.TAR_POS_PRODUCT as tp
ON tp.ProductCode=tod.ProductCode