在我查询所有用户信息的时候 sql语句报错:
报错信息:
### The error occurred while setting parameters
### SQL: SELECT FROM user
### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM user' at line 3
; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM user' at line 3] with root cause
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM user' at line 3**
这个是sql语句:
<select id="queryAll" resultType="User">
SELECT <include refid="column" /> FROM user
</select>
这个是sql片段:
<sql id="column">
<trim suffixOverrides=",">
<if test="_parameter !=null">
user_id,
</if>
<if test="_parameter !=null">
user_account,
</if>
<if test="_parameter !=null">
password,
</if>
<if test="_parameter !=null">
user_name,
</if>
<if test="_parameter !=null">
year,
</if>
<if test="_parameter !=null">
email,
</if>
<if test="_parameter !=null">
note,
</if>
</trim>
</sql>