老大们救名!!!!!!!!!!!!!!!!!!!
IDWB 2004-02-16 03:02:51 declare @SF bit,
@YHLB bit
set @SF=1
set @YHLB=1
select * from yonghu_info
where YHID in (case when @SF is not null or @YHLB is not NULL then
(select DISTINCT YHH from ZYGX
where WYFSF=(case when @SF is not NULL then @SF else WYFSF end)
and WYFFS=(case when @YHLB is not NULL then @YHLB else WYFFS end)
)
else YHID end
)
当@SF=1 @YHLB=1 或 @SF=1 @YHLB=null 或 @SF=null @YHLB=1
就会出错:Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
而当@SF=0 @YHLB=0 或 @SF=1 @YHLB=0 或 @SF=0 @YHLB=1 或 @SF=null @YHLB=null 时都正确
这到底是为什么啊!!!!!5555555555555555555555555555