TraciShultz
asked on
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
I am hoping someone can explain how to correctly update multiple records in a table using subqueries.
I have one table that 2 fields. The subqueries are returning the correct values for the set and the Where Exists is returning the correct records to update.
any help is greatly appreciated.
I have one table that 2 fields. The subqueries are returning the correct values for the set and the Where Exists is returning the correct records to update.
any help is greatly appreciated.
UPDATE TempFinalTubeListMoves
SET DestRackRow =
(SELECT TempRecompileLastRackPositions.Row AS DestRackRow
FROM TempLastDestRack INNER JOIN
TempRecompileLastRackPositions ON TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc),
DestRackColumn =
(SELECT TempRecompileLastRackPositions.Col AS DestRackCol
FROM TempLastDestRack AS TempLastDestRack INNER JOIN
TempRecompileLastRackPositions AS TempRecompileLastRackPositions ON
TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc)
WHERE EXISTS
(SELECT *
FROM TempLastDestRack AS TempLastDestRack INNER JOIN
TempRecompileLastRackPositions AS TempRecompileLastRackPositions ON
TempLastDestRack.Ident = TempRecompileLastRackPositions.Ident INNER JOIN
TempFinalTubeListMoves AS TempFinalTubeListMoves ON TempLastDestRack.bc = TempFinalTubeListMoves.bc)
Can you mark it answered here as well?
Hi TraciShultz,
Could you please mark this question answered?
Thanks.
Could you please mark this question answered?
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://www.experts-exchange.com/questions/24405310/Subquery-returned-more-than-1-value-Error.html