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 |
|
Incognito
Starting Member
49 Posts |
Posted - 2002-02-03 : 09:32:38
|
| Hello,I try to update several records comparing to another table.I got when I execute I get the error:Server: Msg 512, Level 16, State 1, Line 1Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.The statement has been terminated.Do someone have any suggestions?My query is:Update Dmisre01SET zoeknaam =(Select Distinct Klanten.FirmaIDFrom Dmisre01, Klanten, KlantadressenWhere Klanten.FirmaID = Klantadressen.FirmaID andPostcode = Postpostkode and Telefoonre01 = Telefoon)WHERE Zoeknaam IN(Select Dmisre01.ZoeknaamFrom Dmisre01, Klanten, KlantadressenWhere Klanten.FirmaID = Klantadressen.FirmaID andPostcode = Postpostkode and Telefoonre01 = Telefoon) |
|
|
Nazim
A custom title
1408 Posts |
Posted - 2002-02-03 : 10:07:24
|
| Try on this linesUpdate DSET D.zoeknaam =k.firmaidfrom Dmisre01 d, Klanten k , Klantadressen kaWhere K.FirmaID = Ka.FirmaID andd.postcode = Postpostkode and Telefoonre01 = TelefoonAbout your ErrorA subquery when compared with =, !=, <, <= , >, >= expects only one value and yours is returning multiple values , thus the error.--------------------------------------------------------------Dont Tell God how big your Problem is , Tell the Problem how Big your God is |
 |
|
|
|
|
|
|
|