Description issue
Problem says, orders table CAN contain dupicate rows. But notice, how I get erro when using second solution (I am filtering duplicate rows)\n\nCorrect one.\n\'\
Problem says, orders table CAN contain dupicate rows. But notice, how I get erro when using second solution (I am filtering duplicate rows)\n\nCorrect one.\n\'\'\'\nselect p.product_name, sum(o.unit) as unit\nfrom Products p inner join (select * \n                                        from Orders \n                                            where Year(order_date)=2020 and\n                                                  Month(order_date) = 2\n                                        ) as o \n                            on p.product_id = o.product_id\n    group by p.product_id\n    having sum(o.unit) >=100\n\'\'\'\n\nThis one is wrong.\n\n\'\'\'\nselect p.product_name, sum(o.unit) as unit\nfrom Products p inner join (select distinct * \n                                        from Orders \n                                            where Year(order_date)=2020 and\n                                                  Month(order_date) = 2\n                                        ) as o \n                            on p.product_id = o.product_id\n    group by p.product_id\n    having sum(o.unit) >=100\n\'\'\'
[]