SQL how to subtract result row 1 from row 2, row 2 from row 3
问题 How do I subtract row 1 from row 2 and row 2 from row 3, etc. in MySQL? The table i am pulling my data from contains multiple products and all products have multiple prices (on different dates) The code i am working with: SELECT orderline_sales.product_name, orderline_sales.price FROM orderline_sales GROUP BY price HAVING orderline_sales.product_name = 'Ibuprofen'; The result I am getting: |---------------------|------------------| | product_name | price | |---------------------|-------------