postgresql:错误:不允许负子字符串长度

时间:2018-03-24 14:00:45

标签: sql database postgresql substring string-length

我在postgresql中运行以下查询时收到错误消息ERROR:不允许负子字符串长度:

update main as m set filcase_type=subquery.filcase from
(SELECT filcase_type ,
Position('SR' in filcase_type) ,substring(filcase_type,1,position('SR' in filcase_type)-1)  as filcase
FROM main) as subquery 
WHERE right(m.filcase_type,2)='SR';

对可能被忽略的内容提出任何建议?谢谢!

0 个答案:

没有答案