select b.product_id, product_name, competitor_name, 
total_sales_amount_of_product,
total_sales_amount_of_product-total_competitor_sales_amount_2023 as sales_difference_with_competitor
from (
    select product_id,
    sum(quarter_1_sales_amount+quarter_2_sales_amount+quarter_3_sales_amount+quarter_4_sales_amount) as total_sales_amount_of_product
    from sales_info
    group by product_id
) a join oppo_products_detail b on a.product_id=b.product_id
join competitor_analysis c on a.product_id=c.product_id
order by b.product_id