I wrote a very simple SQL statement (CheckBox component), but I don't know why first version does not work (with hash value), but the second version does work fine (without hash value, only one user)
String sql = "select email from `jwdb`.`dir_user` where id = (Select userId from `jwdb`.`dir_employment` where id = (Select t1.hod from `jwdb`.`dir_department` as t1 left join `jwdb`.`dir_employment` as t2 on t1.organizationId = t2.organizationId and t1.id = t2.departmentId where t2.userId = '#currentUser.id#')) Union All select email from `jwdb`.`dir_user` where id = (Select userId from `jwdb`.`dir_employment` where id = (Select t3.hod from `jwdb`.`dir_department` as t3 where t3.Id = (Select t1.parentId from `jwdb`.`dir_department` as t1 left join `jwdb`.`dir_employment` as t2 on t1.organizationId = t2.organizationId and t1.id = t2.departmentId where t2.userId = '#currentUser.id#'))) Limit 1;";
String sql = "select email from `jwdb`.`dir_user` where id = (Select userId from `jwdb`.`dir_employment` where id = (Select t1.hod from `jwdb`.`dir_department` as t1 left join `jwdb`.`dir_employment` as t2 on t1.organizationId = t2.organizationId and t1.id = t2.departmentId where t2.userId = 'user1')) Union All select email from `jwdb`.`dir_user` where id = (Select userId from `jwdb`.`dir_employment` where id = (Select t3.hod from `jwdb`.`dir_department` as t3 where t3.Id = (Select t1.parentId from `jwdb`.`dir_department` as t1 left join `jwdb`.`dir_employment` as t2 on t1.organizationId = t2.organizationId and t1.id = t2.departmentId where t2.userId = 'user1'))) Limit 1;";
Hi,
I wrote a very simple SQL statement (CheckBox component), but I don't know why first version does not work (with hash value), but the second version does work fine (without hash value, only one user)
Version 1
Version 2
Maybe you have an idea why this happens?
Regards
McStar