I currently have a table called pairs_of_products that has the following two columns:
product_id_1, product_id_2
I would like to create a temporary table called monthly_orders that will have the following columns:
product_id, monthly_orders
and then join it to pairs_of_products so that I can end up with a new table with the following columns
product_id_1, product_id_2, monthly_orders_1, monthly_orders_2
I am not sure how to go about this in an efficient way - though I am sure that I would like to only create monthly_orders
once.