sqlserver single row split into a plurality of rows, divided by commas split into new cell line Gerry

The SELECT a.id audit ID, B.value approver ID
     the FROM (
         the SELECT ID, reviewer ID =  the CONVERT (XML, ' <the root> <V> '  +  the REPLACE (moderator ID, ' , ' , ' </ V> <V> ' ) +  ' </ V> </ the root> ' ) the FROM contract itself Checklist 
    ) A 
    OUTER the APPLY (
         the SELECT value = Nvvalue ( ' . ' , ' VARCHAR (100) ') The FROM A. reviewer ID.nodes (' / The root / V ' ) N (V) 
    ) B 

SELECT  *  from contract review BiaoShen

 

Guess you like

Origin www.cnblogs.com/CarryYou-lky/p/10953919.html