title: How to Join Multiple Queries with Multiple Conditions in Mysql from Single Table in PHP?
body: <p>I have a single table in MySQL</p>
  
  <pre><code>------------------------------
  | ID | Subject | Marks | Term |
  -------------------------------
  | 1  | English | 45    | 1    |
  | 2  | Hindi   | 34    | 1    |
  | 3  | English | 54    | 2    |
  | 4  | Hindi   | 33    | 2    |
  ------------------------------
  </code></pre>
  
  <p>I want the output like:</p>
  
  <pre><code>--------------------------------------
  | Subject | Marks_Term1 | Marks_Term2 |
  --------------------------------------
  | English |  45         | 54          |
  |  Hindi  |  34         | 33          |
  --------------------------------------
  </code></pre>
  
  <p>Please help me with the code, reply will be appreciated.</p>
  
  <pre><code>SELECT marks_entry.subject_id, marks_entry.main_exam, marks_entry.main_exam
  FROM marks_entry 
  WHERE marks_entry.term_id = 1 
   LEFT JOIN SELECT marks_entry.subject_id, marks_entry.main_exam, marks_entry.main_exam FROM marks_entry WHERE marks_entry.term_id = 2
  </code></pre>