I created an SQL query which updates a table column where another column = value
CODE:
Update Products Set ProductName = 'Shoes' WHERE ProductID = (1,2,3,4,5,6,7,8)
The problem is with the ProductID
. How can I make it update the column with those ID's ?
Regards.
Replace ProductID =
with ProductID IN
Update Products
Set ProductName = 'Shoes'
WHERE ProductID IN (1,2,3,4,5,6,7,8)
You just use "IN":
Update Products Set ProductName = 'Shoes' WHERE ProductID in (1,2,3,4,5,6,7,8)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With