I have table named dbo.Movies and now i want update 3 rows
This statement works only with one record
declare @movietype nvarchar(100) = 'Thriller' declare @price real = 10 if @price < (select Price from dbo.Movies where MovieType = @movietype) begin update mo set mo.Price = Price - @price FROM dbo.Movies as mo WHERE mo.MovieType = @movietype end
but when i try run this statement to update this 3 rows i got error
"Msg 512, Level 16, State 1, Line 3 Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."
How i can fix this query to update 3 or more rows?