16-异常-造成org.postgresql.util.PSQLException ERROR multiple assignments to same column xxx的两种可能原因及解决办法
更多内容欢迎关注我(持续更新中,欢迎Star✨)
Github:CodeZeng1998/Java-Developer-Work-Note
技术公众号:CodeZeng1998(纯纯技术文)
生活公众号:好锅(Life is more than code)
CSDN: CodeZeng1998
其他平台:CodeZeng1998、好锅
问题描述:运行程序时,某个功能出现了org.postgresql.util.PSQLException ERROR multiple assignments to same column "xxx"的报错。
报错信息:
org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: org.postgresql.util.PSQLException: ERROR: multiple assignments to same column "xxx"
### The error may exist in com/XxxMapper.java (best guess)
### The error may involve com.XxxMapper.update-Inline
### The error occurred while setting parameters
### SQL: UPDATE tableName SET xxx=?, xxx=? WHERE id=0 AND flag=0
### Cause: org.postgresql.util.PSQLException: ERROR: multiple assignments to same column "xxx"
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: multiple