How to get count of an object, through 3 different tables in postgres with ID's stored in each table
select c.prefered_contact_method,count(*) 
from orders  o 
inner join contact c on o.contact_id=c.id
inner join order_details od on od.orders_id=o.id
group by c.prefered_contact_method