title: need multiple outputs from single query - mysql
body: <p>I want following output in mysql using single query from single table.</p>
  
  <pre><code>Total  Pending   Critical   Completed
    120      45         45         30
  </code></pre>
  
  <p>right now I am doing using 4 queries for for different column
  like </p>
  
  <pre><code>select count(*) total from Y; -- for first column
  select count(*) as Pending from Y where status = 0--- for second column
  select count(*) as critical from Y where type = 'Critical' -- for third column
  </code></pre>
  
  <p>What I want, I want this in single query 
  something like </p>
  
  <pre><code>select count(*) as total,count(*) pending where XYZ,
  </code></pre>
  
  <p>I am not getting what to write in where because conditions are different for each output,
  if we write </p>
  
  <pre><code>select count(*) as total,count(*) pending where status = 0 
  </code></pre>
  
  <p>then it gives</p>
  
  <pre><code>total pending
    45      45
  </code></pre>
  
  <p>but I want </p>
  
  <pre><code>total pending
    120      45
  </code></pre>
  
  <p>Please help me,</p>