comparing null in SQL comparisons

前端 未结 5 463
梦谈多话
梦谈多话 2021-01-24 09:56

I am creating a front end with VB6 and my database is Sybase. Using DSN I have created some small exe\'s to populate reports in grid. It was working fine.

However if I u

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-24 10:11

    Nicholas, I agree with you in that comparisons against null should always be false, however I tried the following code on an ASE 15.0.3 server and got a surprising result

    declare @xx int
    select @xx = null
    select @xx
    select 1 where null = @xx
    

    It return 1 for the second select which I was not expecting..

提交回复
热议问题