Skip to content
Advertisement

SQL update with more than 2 records

I’m trying to update column in this table:

Expected result:

And this is my update query – I get an error and I’m not sure where the issue comes from. Thank you.

Error

Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

Advertisement

Answer

No subquery is needed:

That said, storing such redundant information is usually not a good idea. You can just call the function.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement