拼接字符串(行政区划)

   SELECT
          chosecod  =  stuff( ( select '/' + AREA_NAME
from ss_sys_area
where 
 CHARINDEX(',' + area_code + ',', ',' + TB_UNIT_CODE + ',') > 0
and TENANT_ID = '1a8b15af-830f-4f30-8ae8-a43a7bb454f7'
 
for xml path('')
),1,1,'') 
        FROM
          T_SAFETY_RESPONE_CALIM t2
TB_UNIT_CODE = 110000,110100,110105

 

posted on 2024-05-11 11:20  五官一体即忢  阅读(2)  评论(0编辑  收藏  举报

导航