Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem in performing case statement [CORE3337] #3703

Closed
firebird-automations opened this issue Feb 5, 2011 · 4 comments
Closed

problem in performing case statement [CORE3337] #3703

firebird-automations opened this issue Feb 5, 2011 · 4 comments

Comments

@firebird-automations
Copy link
Collaborator

Submitted by: mauro russo (mrusso)

the query

select distinct (case NULL when NULL then 0 else 1 end) as v from RDB$DATABASE

wrongly returns 1

whereas the query

select distinct (case when NULL is NULL then 0 else 1 end) as v from RDB$DATABASE

correctly returns 0

@firebird-automations
Copy link
Collaborator Author

Commented by: @asfernandes

There is no problem here.

The first form compares NULL = NULL, which is obviously false.

The first form equivalent is:
select distinct (case when NULL = NULL then 0 else 1 end) as v from RDB$DATABASE

@firebird-automations
Copy link
Collaborator Author

Modified by: @asfernandes

status: Open [ 1 ] => Resolved [ 5 ]

resolution: Won't Fix [ 2 ]

@firebird-automations
Copy link
Collaborator Author

Commented by: @paulvink

Indeed this is 100% correct.

See http://www.firebirdsql.org/manual/nullguide-conditionals-loops.html#nullguide-case

@firebird-automations
Copy link
Collaborator Author

Modified by: @pcisar

status: Resolved [ 5 ] => Closed [ 6 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant