sql语句在程序中执行报错,打印输出到DB中执行正常怎么回事?
selecta.IDPK,a.Information,one.`ContainerName`ASCone,two.`ContainerName`ASCtwo,three....
select a.IDPK , a.Information, one.`ContainerName` AS Cone , two.`ContainerName` AS Ctwo , three.`ContainerName` AS Cthree , four.`ContainerName` AS Cfour , CASE WHEN b.Flag = 1 THEN d.SeedName WHEN b.Flag = 0 THEN e.MaterialName END AS name FROM remindrecord_tbl a LEFT JOIN seedstorage_tbl b ON b.IDPK = a.SeedStorageIDFK LEFT JOIN remindtype_dic c ON c.IDPK = a.RemindtypeIDFK LEFT JOIN container_tbl one ON one.IDPK = b.ContainerIDFK LEFT JOIN container_tbl two ON two.IDPK = one.fid LEFT JOIN container_tbl three ON three.IDPK = two.fid LEFT JOIN container_tbl four ON four.IDPK = three.fid LEFT JOIN seed_tbl d ON d.IDPK = b.SeedID LEFT JOIN material_tbl e ON e.IDPK = b.SeedID where 1 =1 and c.RemindModel = 1 and a.ProcessLabel = 0 and a.Adduser = '89' ORDER BY a.IDPK DESC limit 2
2014-03-19 14:31:50,484 ERROR [org.hibernate.util.JDBCExceptionReporter] - Column 'ContainerName' not found.
2014-3-19 14:33:37 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Column 'ContainerName' not found.
但是ContainerName这个字段是存在的。 展开
2014-03-19 14:31:50,484 ERROR [org.hibernate.util.JDBCExceptionReporter] - Column 'ContainerName' not found.
2014-3-19 14:33:37 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet jsp threw exception
java.sql.SQLException: Column 'ContainerName' not found.
但是ContainerName这个字段是存在的。 展开
展开全部
把错误信息贴出来啊,没有错误信息有这个也没有用啊。ContainerName这个字段是存在的我承认你说的这个字段是存在的,前提是在对应的表中存在。依照你sql中这个:one.`ContainerName` AS Cone , two.`ContainerName` AS Ctwo , three.`ContainerName` AS Cthree , four.`ContainerName` AS Cfour
,说明这个ContainerName在别名为one~four的这些表里。你检测下这些表里都有没有这个字段。
,说明这个ContainerName在别名为one~four的这些表里。你检测下这些表里都有没有这个字段。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询