I tried to aliase different parts of the code but no matter what i do i still get the error
Column \'product_id\' in from clause is ambiguous