title: redshift query to get desired output
body: <p>In redshift for a provided dataset for a restaurant</p>
  
  <p>Every Dish_id is being assigned to a category 
  So based on the distinct orders which are being palced 
  I need to find out  for a provided primary dish what all other items went along with it<br>
  primary item (every distinct item of that restaurant will act as a primary dish once)</p>
  
  <p>Currently i am able to do it for a single dish_id and getting its contribution</p>
  
  <pre><code>Select category_name,count(category_name) from  ( 
  </code></pre>
  
  <p><code>Select order_id,dish_id,dish_name,category_id,category_name from abc<br>
  where order_id in (Select distinct order_id from abc where dish_name='Paneer_pizza' and restaurant_id=1) 
  group by order_id,dish_id,dish_name,category_id,category_name
  order by category_name
  )
  group by category_name</code></p>
  
  <p>Question's</p>
  
  <blockquote>
    <p>How can i print Panner_pizza in the outer query along with category_name and count?</p>
    
    <p>How can i pass all the dish_name present in that restaurant in inner query 
    and get the contribution for all the dishes along with count for all the categories?</p>
  </blockquote>