title: Why is my program returning empty dataframe using sqldf
body: <p>The below code is returning empty dataframe. The reason am using case statement is : if there is mismatch in stat_id_cd between stat_genius and stat_npps, it populates with the delimiter. The below code was working for a single row but not for more than one row.</p>
  <p>Below is the dataframe stat_genius followed by stat_npps dataframe</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>POL_REF_NO</th>
  <th>POL_NUM</th>
  <th>STAT_ID_CD</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>MPK100</td>
  <td>MPK1000</td>
  <td>4A</td>
  </tr>
  <tr>
  <td>MPK100</td>
  <td>MPK1000</td>
  <td>4B</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Below is the second dataframe.</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>POL_REF_NO</th>
  <th>POL_NUM</th>
  <th>STAT_ID_CD</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>MPK100</td>
  <td>MPK1000</td>
  <td>4A</td>
  </tr>
  <tr>
  <td>MPK100</td>
  <td>MPK1000</td>
  <td>4B</td>
  </tr>
  </tbody>
  </table>
  </div>
  <pre><code>stat_result = sqldf('''
  select 
     a.POL_REF_NO
     , a.POL_NUM
     , CASE     
        WHEN a.STAT_ID_CD = b.STAT_ID_CD THEN a.STAT_ID_CD
        ELSE a.STAT_ID_CD||' | '||b.STAT_ID_CD END AS STAT_ID_CD 
  FROM stat_genius a  
  JOIN stat_npps b on b.POL_REF_NO = a.POL_REF_NO and b.STAT_ID_CD = a.STAT_ID_CD''')
  
  print(stat_result)
  </code></pre>