title: SQL Search refresh by row
body: <p>I am trying to using select scripts to extract the weekday column from a table in the database. And dividing "MWF" into "Monday", "Wednesday" and "Friday". Each day need to display in an individual row. </p>
  
  <p>What I have here is :</p>
  
  <pre><code>SELECT
      REGEXP_SUBSTR(MEETING_DAY, '[^,]+', 1, LEVEL, 'i'), FROM_TIME_HHIIAP  as DAY 
  FROM
      (SELECT
          CASE WHEN (DAY_MEET.MEETING_DAYS = 'F')THEN ('Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'FS')THEN ('Friday,Saturday')
               WHEN (DAY_MEET.MEETING_DAYS = 'M')THEN ('Monday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MF')THEN ('Monday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MT')THEN ('Monday,Tuesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MTH')THEN ('Monday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MTTH')THEN ('Monday,Tuesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MTW')THEN ('Monday,Tuesday,Wednesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MTWTH')THEN ('Monday,Tuesday,Wednesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MTWTHF')THEN ('Monday,Tuesday,Wednesday,Thursday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MW')THEN ('Monday,Wednesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MWF')THEN ('Monday,Wednesday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'MWTH')THEN ('Monday,Wednesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'S')THEN ('Saturday')
               WHEN (DAY_MEET.MEETING_DAYS = 'T')THEN ('Tuesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'TH')THEN ('Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'THF')THEN ('Thursday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'TTH')THEN ('Tuesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'TTHF') THEN  ('Tuesday,Thursday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'TW')THEN ('Tuesday,Wednesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'TWTH')THEN ('Tuesday,Wednesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'W')THEN ('Wednesday')
               WHEN (DAY_MEET.MEETING_DAYS = 'WF')THEN ('Wednesday,Friday')
               WHEN (DAY_MEET.MEETING_DAYS = 'WTH')THEN ('Wednesday,Thursday')
               WHEN (DAY_MEET.MEETING_DAYS = 'WTHF')THEN ('Wednesday,Thursday,Friday')
               ELSE ('Unknown')
           END MEETING_DAY, 
           DAY_MEET.*
       FROM 
           UTDBA.IS_167_DAY12_MEETING_INFO DAY_MEET)
  
  CONNECT BY LEVEL &lt;=  
             LENGTH(MEETING_DAY) - LENGTH(REGEXP_REPLACE(MEETING_DAY, ',', ''))+1; 
  </code></pre>
  
  <p>But seems like the LEVEL stays at the last character after the first row, so the result is wrong. Anyone knows how to refresh Level back to the first word for each row?</p>