title: Comparing Multiple Values from one table to Multiple Values in another
body: <p>I have a PL/SQL stored function script I am writing and I have run into a problem.</p>
  
  <p>I need to find ALL Applicants who possess ALL the skills needed for a task and display them. </p>
  
  <p>I have a method where I have individually read in Applicant's skills into a <code>VARCHAR2</code> string and all the Skills required into another. If I could separate these strings into individual words I could compare the two with <code>LIKE '% &lt;data&gt; %'</code>. </p>
  
  <p>How would I go about this (or what is an alternative method)?</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION FUBARR(num IN NUMBER) RETURN VARCHAR IS
    string_position VARCHAR2(128);
    string_applicant VARCHAR2(128);
    string_results VARCHAR2(128);
  BEGIN  
    string_position := '';
    string_applicant := '';
  
  
    FOR SKILLS_row IN (SELECT sname FROM SNEEDED WHERE pnumber = num)
    LOOP
      string_position := string_position || SKILLS_row.sname || ' ';
    END LOOP;
  
    FOR EVERYBODY_row IN (SELECT UNIQUE anumber FROM SPOSSESSED ORDER BY anumber)
    LOOP
      FOR APPLICANTS_row IN (SELECT sname FROM SPOSSESSED WHERE SPOSSESSED.anumber = EVERYBODY_row.anumber)
      LOOP 
          string_applicant := string_applicant || APPLICANTS_row.sname || ' ';
      END LOOP;
      --DBMS_OUTPUT.PUT_LINE(EVERYBODY_row.anumber || ' ' || string_applicant);
  
  
      --IF blaah != LIKE BLAh
      IF 
  
  
      string_applicant := '';
    END LOOP;
  
  
    --DBMS_OUTPUT.PUT_LINE(string_position);
    --RETURN (string_position);
    RETURN('help');
  END FUBARR;
  /
  </code></pre>