title: How do I arrange the data by different WHERE conditions into different columns?
body: <p>I have a table that have 3 columns (SID,SUBJECT,MARKS):</p>
  
  <pre><code>╔══════╦═════════╦═══════╗
  ║ SID  ║ SUBJECT ║ MARKS ║
  ╠══════╬═════════╬═══════╣
  ║ 1A01 ║ ENG     ║    66 ║
  ║ 1A02 ║ ENG     ║    75 ║
  ║ 1A01 ║ MATH    ║    60 ║
  ║ 1A03 ║ ENG     ║    73 ║
  ║ 1A02 ║ MATH    ║    35 ║
  ║ 1A03 ║ MATH    ║    80 ║
  ║ 1A01 ║ CHI     ║    65 ║
  ║ 1A02 ║ CHI     ║    74 ║
  ║ 1A03 ║ CHI     ║    78 ║
  ╚══════╩═════════╩═══════╝
  </code></pre>
  
  <p>And I want to group the data by the SID in each row like:</p>
  
  <pre><code>╔══════╦═════╦═════╦══════╗
  ║ SID  ║ CHI ║ ENG ║ MATH ║
  ╠══════╬═════╬═════╬══════╣
  ║ 1A01 ║  65 ║  66 ║   60 ║
  ║ 1A02 ║  74 ║  75 ║   35 ║
  ║ 1A03 ║  78 ║  73 ║   80 ║
  ╚══════╩═════╩═════╩══════╝
  </code></pre>
  
  <p>I am new in mysql, I tried to use subquery and UNION but it failed.
  Can anyone please give me some hints?</p>