title: JOIN with LIKE is taking too long
body: <p>I have a query that is taking to long (over 6 hours).
  I'm trying to find for each ID the length of the teams that he is part of (the team are combination of all the ID's in the team separated by ',' ) so that later I will be able to filter on the Maximum team length (which is the most recent one ).
  I'm trying to do it with a JOIN with LIKE condition
  and it takes a lot of time.</p>
  <p>This is the first query:</p>
  <pre><code>CREATE TABLE TEMP AS
  SELECT I.ID ID,E.TEAM TEAM,LENGTH(E.TEAM ) LEN
  FROM TEAM_TABEL I JOIN TEAM _TABEL E
  ON E.TEAM LIKE '%'|| I.ID||'%'
  ;
  </code></pre>
  <p>This is the second query that I used to get the maximum length:</p>
  <pre><code>CREATE TABLE TEMP2 AS
  SELECT ID,MAX(LEN) MAX_LEN
  FROM TEMP
  GROUP BY ID;
  </code></pre>
  <p>Is There a more efficient way to do it so it will not take so long?</p>
  <p>An example for dataset creation:</p>
  <pre><code>CREATE TABLE TEAM_TABEL (
  ID VARCHAR2(20),
  TEAM  VARCHAR2(1000) 
  );
  
  INSERT INTO RAW_DATA (ID,TEAM)
  SELECT 'x1','x1,x3,x5' FROM DUAL
  UNION ALL SELECT 'x2','x2,x3,x5' FROM DUAL
  UNION ALL SELECT 'x1','x1,x2,x3,x5' FROM DUAL
  UNION ALL SELECT 'x4','x4' FROM DUAL
  UNION ALL SELECT 'x5','x1,x2,x3,x' FROM DUAL
  UNION ALL SELECT 'z3','z3' FROM DUAL
  </code></pre>