为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:
【操作系统】:Windows Server 2016 Datacenter
【CPU】:Intel(R)Xeon(R)Silver 4210R CPU @ 2.40GHZ2.39 GHz(6 个处理器)
【问题描述】*:执行SQL报[22000][-2207] 无法解析的成员访问表达式[CEIL2]
-- 报[22000][-2207] 无法解析的成员访问表达式[CEIL2]
select count(*)
from cg_chargeitem a
left join ma_meteracc b on b.id = a.accid and b.orgid = a.orgid
left join ma_book d on d.id = b.bookid and d.orgid = a.orgid
left join mr_bill c on c.id = a.billid and c.orgid = a.orgid
left join cg_charge e on e.id = a.chargeid and e.orgid = a.orgid
WHERE a.chargedate >= to_date('2017-03-27 00:00:00')
AND a.orgid = '1002'
AND NOT a.billid = 0
AND a.payamount >= 0
AND a.chargetype = 0
AND b.areaid IN (1109001, 1109103, 2109001)
AND (NOT c.chargewayno = 'XTYS' OR c.chargewayno IS NULL);
1.去除
a.chargedate >= to_date('2017-03-27 00:00:00')
或者
AND b.areaid IN (1109001, 1109103, 2109001)
条件后均正常执行
2.去除to_date函数,直接通过字符串比较也正常
a.chargedate >= '2017-03-27 00:00:00'
3.直接等于也正常
a.chargedate = to_date('2017-03-27 00:00:00')
加上格式试试呢
a.chargedate >= to_date('2017-03-27 00:00:00','yyyy-mm-dd hh24:mi:ss')
你好,请问 a.chargedate 是什么类型的字段?
您试下将这样改写是否能正常执行?
TO_CHAR(to_date('2017-03-27 00:00:00'))