MyBatis报错have a different number of columns的解决办法
Java •
### Cause: java.sql.SQLException: The used SELECT statements have a different number of columns
; bad SQL grammar []; nested exception is java.sql.SQLException: The used SELECT statements have a different number of columns
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.doTranslate(SQLStateSQLExceptionTranslator.java:101)
原因是SQl语句使用了union,但是字段个数不一致!
检查一下字段个数,必须一致,就解决了。