My SQL query
UPDATE Task SET Done = 1 WHERE (ID = (SELECT ID FROM User WHERE UserName = @UserName)
I tried and got an error:
Subquery returned more than 1 value. This is not permitted when the
subquery follows =, !=, <, <= , >, >= or when the subquery is used as
an expression. The statement has been terminated.
Is there any possible way to do that (for example a for loop)? Thanks
How would a row’s ID be equal to more than one value?
That doesn’t make sense, which is why writing such a query isn’t possible.
Checking if the ID is in a set would make sense, though…
...WHERE ID IN (SELECT ID...