SHARE
TWEET

Untitled

a guest Oct 12th, 2017 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Recipients
  2. ------------
  3. R23198U,R324I98
  4.    
  5. Recipients
  6. ------------
  7. Lonnie Lawson, Stan Smith
  8.    
  9. SELECT (SELECT Listagg(full_name, ',')
  10.              within GROUP(ORDER BY full_name) AS CC_Recipients
  11.     FROM   (SELECT first_name
  12.                    ||' '
  13.                    ||last_name AS full_name
  14.             FROM   users_table
  15.             WHERE  user_name IN (SELECT DISTINCT Trim(Regexp_substr(
  16.                                 cc_recipients,
  17.                                 '[^,]+', 1,
  18.                                                      LEVEL))
  19.                                  FROM   dual
  20.                                  CONNECT BY Regexp_substr(
  21.                                             cc_recipients,
  22.                                             '[^,]+', 1,
  23.                                             LEVEL) IS
  24.                                             NOT NULL))t) AS cc_rec
  25. FROM   email_queue
  26. WHERE  cc_recipients IS NOT NULL;
  27.    
  28. CC_REC                      CC_RECIPIENTS
  29. Lonnie Lawson,Stan Smith    R23198U,R324I98
  30. Lonnie Lawson,Stan Smith    R23198U
  31. Lonnie Lawson,Stan Smith    R23198U
  32. Lonnie Lawson,Stan Smith    R23198U
RAW Paste Data
Top