oracle 中Like 后面如何用字段名进行模糊查询,而不是用字符串。
下面的SQL语句总是不成功,不知道是为什么?SELECT*FROM(SELECTID,DEPARTMENTNAME,DEPARTMENTORDER,OFFICEFILEF...
下面的SQL语句总是不成功,不知道是为什么? SELECT * FROM (SELECT ID,DEPARTMENTNAME,DEPARTMENTORDER,OFFICEFILE FROM SETDEPARTMENT WHERE OfficeFile=1) a LEFT OUTER JOIN (SELECT ID,BACKOFFICE,BACKTIME,CONTENT,TOOFFICE FROM OFFICEDATA WHERE id=6228) b ON b.TOOFFICE LIKE '%'+a.DEPARTMENTNAME+'%' 最后一句总是提示如下错误: 执行失败:ORA-01722: 无效数字 SELECT * FROM (SELECT ID,DEPARTMENTNAME,DEPARTMENTORDER,OFFICEFILE FROM SETDEPARTMENT WHERE OfficeFile=1) a LEFT OUTER JOIN (SELECT ID,BACKOFFICE,BACKTIME,CONTENT,TOOFFICE FROM OFFICEDATA WHERE id=6228) b ON OfficeFile=1 and b.TOOFFICE LIKE '%'+a.DEPARTMENTNAME+'%' 到底是为什么呢?
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询