写一个sql文,取包含有某个字符串的所有字段,详见下文
SELECTorganization_.treePath ,
FROMorganization_
WHERE organization_.treePath
LIKE('%10001%')
要取出所有的包含organizationId的treepath,现在我的organizationId定的死值10001
取organizationId的sql文如下:
SELECT organizationId
FROMorganization_
INNER JOIN expandovalue
INNER JOIN expandocolumn
WHERE expandovalue.classPK = organization_.organizationId
AND expandovalue.columnId = expandocolumn.columnId
AND expandocolumn.`name` = 'client-id'
现在不能将下面的sql文替换上面的like部分,求大侠帮忙,再线等
[解决办法]
试试看:
SELECT s.treePath FROM organization_ s INNER JOIN (SELECT ss.organizationIdFROM organization_ ssINNER JOIN expandovalue INNER JOIN expandocolumn WHERE expandovalue.classPK = ss.organizationId AND expandovalue.columnId = expandocolumn.columnId AND expandocolumn.`name` = 'client-id' ) temp ON INSTR(s.treePath,temp.organizationId)>0