Openx postgres错误

时间:2011-01-27 12:12:28

标签: php postgresql openx

我在postgres上安装了OpenX,我在统计页面上收到错误:

MDB2 Error: unknown error

_doQuery: [Error message: Could not execute statement]
[Last executed query: SELECT m.clientid AS advertiser_id,d.campaignid AS placement_id,s.ad_id AS ad_id,SUM(s.impressions) AS sum_views,SUM(s.clicks) AS sum_clicks,SUM(s.revenue) AS sum_revenue, m.campaignid || IF( LENGTH(market_advertiser_id) > 0, ('_' || market_advertiser_id || '_'),  '_') || ad_width || ' x ' || ad_height  AS ad_id,( m.campaignid || IF( LENGTH(market_advertiser_id) > 0, ('_' || market_advertiser_id || '_'),  '_') || ad_width || ' x ' || ad_height ) AS pkey FROM "ox_ext_market_stats" AS s INNER JOIN "ox_banners" AS d ON (d.bannerid=s.ad_id) INNER JOIN "ox_campaigns" AS m ON (m.campaignid=d.campaignid) INNER JOIN "ox_clients" AS a ON (a.clientid=m.clientid) WHERE s.ad_id IN (1,2) AND s.zone_id = 0 AND a.type = 1 AND s.date_time>='2011-01-26 23:00:00' AND s.date_time<='2011-01-27 22:59:59' AND s.zone_id = 0 GROUP BY advertiser_id,placement_id,pkey]
[Native message: ERROR:  column "s.ad_id" must appear in the GROUP BY clause or be used in an aggregate function at character 65]


Fatal error: Unsupported operand types in /home/me/public_html/openxtest/www/admin/market/stats.php on line 164

所以我的问题是:我必须在哪里编辑修改查询的代码?

1 个答案:

答案 0 :(得分:1)

好的,我找到了解决方案。 要解决此问题,必须在 lib / max / SqlBuilder.php 中的第1031行之后添加此代码:

$aGroupColumns[] = "s.ad_id";