<select id="listComntedProdId" resultType="java.util.Map"> select op.*, oc.comment, oc.score + 0 as score, oc.sid, oc.images, oc.is_show + 0 as is_show, oc.addtime as comment_addtime from onlineshop_comment as oc inner join onlineshop_product as op on oc.goods_id = op.id where oc.user_id = #{uid} order by oc.id DESC <if test="start >=0 and limit>0"> limit #{start},#{limit} </if> </select>
在java环境中运行mybatis相关代码,出错
org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column ‘addtime‘ from result set. Cause: java.sql.SQLException: Column ‘addtime‘ not found.
后将 “oc.addtime as comment_addtime” 改为 "oc.addtime" ,报错消失,原因不明,求助!
JDBC 报错 "SQLException: Column 'addtime' not found",求助!
时间: 2024-09-29 18:45:57