是什么导致“ ubquery返回的值超过1个”错误?
技术问答
182 人阅读
|
0 人回复
|
2023-09-12
|
我不知道为什么我会收到此错误:-
/ R1 f/ K, s9 s0 f. S& TSubquery returned more than 1 value. This is not permitted when the subquery follows =, !=, , >= or when the subquery is used as an expression.
) Q4 p! F9 s2 {* e2 v% z" Z MThe statement has been terminated.3 q& e0 `+ o# A- Y, ~6 h8 t
我正在尝试运行此查询:
3 ?% z9 D* d# {+ pALTER TABLE Test1 NOCHECK CONSTRAINT ALL) P. ~# h% i5 u' \
ALTER TABLE Test2 NOCHECK CONSTRAINT ALL$ U. A5 d2 @6 u* c
+ H% m, k' }! j0 R& R4 l( qUPDATE Test1 : B4 D# \3 K! v9 C
SET ID= '05f6c6b4-63ff-45b2-a5e2-920d5dce3e45' ; L% x0 A$ q7 R
WHERE ID = '05e6c6b4-63ff-45b2-a5e2-920d5dce3e45'; " q$ b; y t5 _/ b/ {/ i
UPDATE Test2 * o3 z0 x) L/ ]% i2 d- G u/ a
SET ID = '05f6c6b4-63ff-45b2-a5e2-920d5dce3e45' ,- Y6 `% w# k# {9 @( ]3 {
SpecID = NULL ,8 v' B8 x ?. `
RefLastName = 'Dummy' ,
. ^- U! Z; Z' p7 U7 I$ O8 fRefFirstName = 'First Name' ,$ W6 q- G7 C/ s) }6 W2 V2 T
RefMiddleName = NULL ,
7 {4 ~% Y& T/ B- O# k( ERefPhone1 = '111444444' ,. T5 M9 E* w+ b& [7 ~
RefPhone2 = '2121222' ,2 H6 d. G! S1 x, c9 D+ I! C4 X
RefFax = '222222' ,% X: q& y+ l) L3 I
RefEmail = 'xxxxxxx@hotmail.ca' # k! p0 ?, J* k) w3 f
WHERE / Y% y. N5 x) |9 ^7 n5 W2 D2 [
RefID = '05e6c6b4-63ff-45b2-a5e2-920d5dce3e45'
! t$ o: t, c$ {0 b1 E- F; yALTER TABLE Test1 WITH CHECK CHECK CONSTRAINT ALL
. ]$ o; X' d6 _- ?ALTER TABLE Test2 WITH CHECK CHECK CONSTRAINT ALL
, \3 G& I0 `& H2 k5 X" n
9 |+ c! N Z. |/ G* \解决方案: |
|
|
|
|
|