naraku9333

Untitled

Dec 15th, 2015
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 0.26 KB | None | 0 0
  1. INSERT INTO NTD
  2.     SELECT
  3.          nat.noteid, tags = REPLACE
  4.          ((SELECT tagname AS [DATA()]
  5.          FROM NAT
  6.          WHERE  noteid = nat.noteid
  7.          ORDER BY noteid FOR xml path('')), ' ', ':')
  8.     FROM         NAT nat
  9.     WHERE     nat.noteid IS NOT NULL
  10.     GROUP BY nat.noteid;
Advertisement
Add Comment
Please, Sign In to add comment