title: MySQL Displaying columns of a group when corresponding rows are of specific values
body: <p>Can anyone assist in formulating a MySQL query such that when rows with action is &quot;CREATED&quot; and/or status is &quot;COMPLETED&quot; then corresponding updated by should be displayed for a casein?</p>
  <p>See attached sample table ;</p>
  <pre><code>id caseid     action                                status             updatedby 
  1 A1000     CREATED                         Open                 1 
  2 A1000     &quot;ASSIGN TO ANALYST&quot;  Open                 1 
  3 A1000    CLAIM                               CLAIMED           5 
  4 A1000    RELEASE                          Open                 5 
  5 A1000    CLAIM                                CLAIMED         5 
  6 A1000     &quot;ACCEPT RISK&quot;               COMPLETED   5 
  </code></pre>
  <p>The expected output should be like below;</p>
  <pre><code>caseid Created By (updatedby) Closed By(updatedby) 
  A1000          1                                  5 
  </code></pre>
  <br/>
  Thanks and regards.