sql:
SELECT oo.ID_ORG,oo.ENTERPRISE_NAME FROM ss_organization oo WHERE FIND_IN_SET(oo.ID_ORG, fun_getChildList(0,14,8)) fun_getChildList(0,14,8)) 为获取组织集合函数
fun_getChildList返回结果如下:
0,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,34,35
问题:
当fun_getChildList返回结果太多时执行FIND_IN_SET需要的时间太长。
百度后得知函数无法在函数返回结果集。
各位有没什么好的办法能优化这种sql。