title: How can use case condition while joining the tables
body: <blockquote>
    <p>How to join the table based on the case condition</p>
  </blockquote>
  
  <pre><code> SELECT *FROM TB_MESSAGE tbm
  LEFT JOIN TB_MESSAGE_RECEPIENT tbmr ON tbmr.MESSAGE_ID = tbm.ID
  CASE 
    WHEN tbm.`TARGET_USERS` = 'INTERNAL' THEN LEFT JOIN `TB_MESSAGE_RECEPIENT_ANOM` tbmra ON tbmra.MESSAGE_ID = tbm.ID
    WHEN tbm.`TARGET_USERS` = 'ANONYMOUS' THEN LEFT JOIN TB_SCHEDULED_MESSAGE tbsm ON tbm.ID = tbsm.MESSAGE_ID
    ELSE LEFT JOIN `TB_MESSAGE_RECEPIENT_ANOM` tbmra ON tbmra.MESSAGE_ID = tbm.ID 
   WHERE tbmr.STATUS = 131 
  </code></pre>