...java.sql.SQLException: ORA-00907: 缺少右括号 这个异常
发布网友
发布时间:2024-10-24 13:12
我来回答
共1个回答
热心网友
时间:1天前
sql 在连接时注意加空格
String sql = "select a.fMateralID,a.fMaterialName,a.fMaterialType,a.fSpecModel,a.fMaterial "
+ "from tblMaterial a join "
+ "(select fMaterialName,fMaterialType,fSpecModel,fMaterial,count(1) as cnt from tblMaterial "
+ "group by fMaterialName,fMaterialType,fSpecModel,fMaterial) b "
+ "on a.fMaterialName=b.fMaterialName and a.fMaterialType=b.fMaterialType "
+ "and a.fSpecModel=b.fSpecModel and a.fMaterial=b.fMateria l"
+ "where b.cnt>1 ";