I have the below table. I want to update the sales price for the product Ball in both row 1 and row 3 based on the Invoice_Date range and the product name.
I have the following sql syntax
update mydb_stock.sql_product_sales set sales_price = 7.5
where invoice_date between '20-03-2024' and '12-04-2024' and product_name = 'Ball';
The above syntax does not work properly. It only update the first row but subsequent rows are not updated.
Invoice_Date | Product_Name | Sales_Price | Quantity | Total_Sales |
---|---|---|---|---|
20-03-2024 | Ball | 3.5 | 4 | 14 |
25-03-2024 | Racket | 2.0 | 3 | 6.0 |
12-04-2024 | Ball | 3.5 | 3 | 10.5 |
I would be grateful if you guys can be of help. Please note that the invoice_date is in varchar. I intentionally did that.
Thanks