title: How to write multiple select statements with multiple where condition in single query?
body: <p>I am working on php with sql .I have one teachers_rating table in database I want to get ratings like how many members are give 5 rating like that only 4, like 3, like so...I used this sql query check once.</p>
  
  <pre><code>    SELECT COUNT( teachers_rating.rating ) AS fivestar
      FROM teachers_rating
      WHERE rating = '5' and id='23'
      UNION
      SELECT COUNT( teachers_rating.rating ) AS fourstar
      FROM teachers_rating
      WHERE rating = '4'and id='23'
      UNION
      SELECT COUNT( teachers_rating.rating ) AS threestar
      FROM teachers_rating
      WHERE rating = '3'and id='23'
  
  like that its running but out output is
  fivestar    
  18
  14
  20
  
  but iwant this type of structure
  fivestar    fourstar threestar
  18           14          20
  </code></pre>
  
  <p>If any one knows please help me.</p>