Multi-line merger

xiaoxiao2021-03-06  39

create function fmerg (@id int) returns varchar (8000) asbegindeclare @str varchar (8000) set @str = '' select @ str = @ str ',' short_name from v_person where psn_code = @ idset @ str = right (@ Str, LEN (@STR) -1) Return (@str) endGO

- Call the custom function Get the result Select Distinct PSN_CODE, DBO.FMERG (PSN_CODE) from V_Person

转载请注明原文地址:https://www.9cbs.com/read-64341.html

New Post(0)