title: mysql how to run two count in same query
body: <p>I have a db with three tables:</p>
  
  <pre><code>Client: ID---Name
  Organization: ID---Descriptio---Client_ID
  Ticket: ID---Organization_ID---Status
  </code></pre>
  
  <p>I can list all the ticket for a specific client with a simple query:</p>
  
  <pre><code>SELECT * 
  FROM Organization JOIN 
  Client ON organization.client_id=client.id
  Ticket ON ticket.organization_ID=organization.id
  </code></pre>
  
  <p>Tickets can have a status open or close so I'd like to run a query thtat will return:</p>
  
  <ul>
  <li>foreach Client.id;</li>
  <li>foreach Organization.id;</li>
  <li>the total number of tickets;</li>
  <li>the count of how many open ones;</li>
  <li>the count of how many close ones;</li>
  </ul>
  
  <p>I can't find a suitable query to run that will give me in the same row both how many open and how many close and the total number. (The total number is to check that each ticket has a status). I need this query to double-check db integrity and fix any issue from the legacy system. 
  I know how to build it in steps but it is a massive amount of data and would be the best to do it in one shot</p>
  
  <p>Any idea?</p>
  
  <p><strong>EDIT: the point is to make two conditional count on the same field in the same query. The question marked as duplicated does not address this specific issue</strong></p>