Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
dowens
Yak Posting Veteran
82 Posts |
Posted - 2007-04-18 : 09:38:16
|
Not sure how to resolve the issue.Receiving error:Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.Table1id seq amt ben1 1 100 5dd101 2 100 5dd10 1 3 100 5dd10Table2ben Netw type5dd10 O dedtable31 300UPDATE table3SET Amt= (SELECT SUM(Amt) FROM table1 t1 INNER JOIN table2 t2 ON t1.Ben = t2.Ben WHERE table3.ID = t1.ID AND (t2.NetW = 'O') AND (t2.Type = 'DED') GROUP BY t1.ID,t1.Ben HAVING SUM(AMT) > 0) |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-04-18 : 09:40:03
|
quote: Originally posted by dowens Not sure how to resolve the issue.Receiving error:Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.Table1id seq amt ben1 1 100 5dd101 2 100 5dd10 1 3 100 5dd10Table2ben Netw type5dd10 O dedtable31 300UPDATE table3SET Amt= (SELECT Coalesce(SUM(Amt), 0) FROM table1 t1 INNER JOIN table2 t2 ON t1.Ben = t2.Ben WHERE table3.ID = t1.ID AND (t2.NetW = 'O') AND (t2.Type = 'DED') GROUP BY t1.ID,t1.Ben HAVING SUM(AMT) > 0)
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
dowens
Yak Posting Veteran
82 Posts |
Posted - 2007-04-18 : 09:43:43
|
THAT WORKED THANK YOU!! |
 |
|
|
|
|
|
|