aspiringprog
MIS
Hi all,
I have this statement. I am trying to update a column in a table using values for a column in another table.
UPDATE a
SET DIAG = (SELECT b.ID
FROM b ,a
WHERE b.ID = a.ID
AND b.TYPE = 'c')
WHERE a.ID =
(SELECT a.ID
FROM b,a
WHERE b.ID = a.ID
AND b.TYPE = 'c')
I keep getting an error saying that the subquery returns multiple values and the command gets aborted.
I am new to SQL server. In oracle we can use cursors(although they are slow). How to work this problem in sql server?(using distinct clows the whole this down a lot).
Help is greatly appreciated.
thanks
I have this statement. I am trying to update a column in a table using values for a column in another table.
UPDATE a
SET DIAG = (SELECT b.ID
FROM b ,a
WHERE b.ID = a.ID
AND b.TYPE = 'c')
WHERE a.ID =
(SELECT a.ID
FROM b,a
WHERE b.ID = a.ID
AND b.TYPE = 'c')
I keep getting an error saying that the subquery returns multiple values and the command gets aborted.
I am new to SQL server. In oracle we can use cursors(although they are slow). How to work this problem in sql server?(using distinct clows the whole this down a lot).
Help is greatly appreciated.
thanks