title: Double group by in multiple tables
body: <p>I have three joined tables.</p>
  
  <pre><code>select * 
  from Ordering 
  inner join Client on client.id=ordering.client_id 
  inner join Dish on ordering.dish_id=dish.id
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/5zAWj.png" alt="enter image description here"></p>
  
  <p>I would like sum <code>quantity</code> column and group by <code>name_dish</code> and later  <code>client_id</code>.</p>
  
  <p>Now I made it but it is not enough (for one client):</p>
  
  <pre><code>select client.familyName, client.name, client.phone, sum(ordering.quantity),dish.name_dish 
  from Ordering 
  inner join Client on client.id=ordering.client_id 
  inner join Dish on ordering.dish_id=dish.id 
  where ordering.client_id=1 
  group by (dish.name_dish)
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/NNFUn.png" alt="enter image description here"></p>