title: To check if last name is part of first name
body: <p>I am working on Data standardization rules, and one of the rules says, "If the last name is part of first name, then remove the last name from first name". 
  my Query- how do i check if first name column has the last name in it using oracle sql developer?</p>
  
  <p>I tried using :</p>
  
  <pre><code>select fst_nm, lst_nm from emp where fst_nm = fst_nm || lst_nm  ;
  </code></pre>
  
  <p>but this query returns '0' results.</p>
  
  <p>Also, I tried another query:</p>
  
  <pre><code>select fst_nm, lst_nm, regexp_substr(fst_nm, '[^ ]+',1,1) from emp ;
  </code></pre>
  
  <p>I tried using the below query</p>
  
  <pre><code>select fst_nm, lst_nm from emp where fst_nm = fst_nm || lst_nm  ;
  </code></pre>
  
  <p>but this query returns nothing, I mean '0' results.</p>
  
  <p>Also, I tried another query:</p>
  
  <pre><code>select fst_nm, lst_nm, regexp_substr(fst_nm, '[^ ]+',1,1) from emp ;
  </code></pre>
  
  <p>expected result is:</p>
  
  <pre><code>fst_nm = john smith ;
  lst_nm = smith
  </code></pre>
  
  <p>Actual result showing up is :</p>
  
  <pre><code>fst_nm = john ;  
  lst_nm = smith
  </code></pre>
  
  <p>Please help</p>