[编辑:这问题是版本内的一个错误的结果3.7.6]碧玉报告:错误:操作符不存在日期=布尔
以下PostgreSQL的查询将返回一个错误:
operator does not exist date = boolean.
我不明白为什么。这是postgresql代码给我的错误:
select
c.source,
s.name,
s.grouping,
s.kli,
s.term_desc,
(s.population - s.online) as non_hb_pop,
s.online as hb_pop,
s.population as full_pop,
s.rep_date
from
dwh.rpt_cu_private_kli_summary s, dwh.rpt_sgmt_clients c
where
s.partner_id::integer = $P{rpt_cu}
and s.rep_date = $P{rpt_date_beg}
and s.userid=c.userid
group by
c.source, s.term_desc, s.name, s.grouping,
s.population, s.online, s.kli, s.rep_date
order by
s.grouping,
full_pop desc,
s.term_desc;
上面的错误信息是什么意思?
“group by”的用途是什么?我看不到使用的聚合体。 – wildplasser 2012-02-15 14:48:27
我以前正在使用聚合,然后在没有除掉GROUP BY的情况下将它们取出。谢谢你指出了我! – precose 2012-02-15 14:54:25
启用查询日志记录并在PostgreSQL日志之外的参数替换后执行查询。发布。您还需要包含以下显示参数的日志行。设置log_statement ='all',重新加载PostgreSQL,重新运行你的查询,钓鱼查询和params出日志,并粘贴在这里。 – 2012-02-21 23:23:39