I am working on SQL database where there are several thousands of lines in one table. This table (product_lines) looks like this:
sku price Discount FinalPrice
1 29 5 24
1 29 5 24
2 30 5 25
2 30 0 30
3 15 0 15
3 15 0 15
Each line contains SKU's information when used in a receipt. SKUs may repeat within the rows (eg sku:2) but discount vary each time. I am trying to collect the items that exist both with and without a value in the column discount -- to collect the SKUs that have sold with and without discount. The result I am looking for should look like:
sku price Discount FinalPrice
2 30 5 25
2 30 0 30
How can I do this?