为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:8.0
【操作系统】:
【CPU】:
【问题描述】*:
SELECT method_id methodId, method method, item_id itemId, item_name itemName, creator_id creatorId,
updator_id updatorId, create_time createTime, update_time updateTime FROM base_detection_method WHERE method = ‘111111121’
其中 method 数据库字段类型是 text 类型。 使用method 作为 where 条件在代码中就报 数类型不匹配 错误 。单独在 数据库控制台执行不报错。
使用其他字段 作为 where 判断条件不报错。
建议外层套一层to_char
WHERE to_char(method) = ‘111111121’
楼主最终解决了吗?
解决了吗,text 类型的字段 不能在where 子语句中吗
在使用SQL时,text类型的字段不能作为where条件后的参数,如果需要作为where参数查询,建议改为varchar类型后再进行