我有一个按预期工作的(加入)查询。但是,一旦我添加了以下列,它就没有显示任何结果,也没有完成。(查询运行计数器不断增长)
IF((d.network_type contains '_user' AND d.is_network=1),s.impressions,0) AS effimp
有没有其他方法可以优化这个?
完整的查询如下,当我在上个月尝试时它正在工作。
SELECT s.date_time AS date_time
, s.requests AS requests, s.impressions AS impressions
, s.clicks AS clicks, s.conversions AS conversions
, IF((d.network_type contains '_user'
AND d.is_network=1),s.impressions,0) AS effimp
, s.total_revenue AS total_revenue
, s.total_basket_value AS total_basket_value
, s.total_num_items AS total_num_items
, s.zone_id as zone_id
FROM company.ox_data_summary s
INNER JOIN company.ox_banners1 AS d ON d.bannerid=s.ad_id
limit 100
查询失败错误:意外。请再试一次。
如果我删除“IF 子句,它确实有效。