0

interview questions select case when null = null then 'Yup' else 'Nope' end as Result;

14th Jul 2016, 6:57 PM
Tijo Joseph
Tijo Joseph - avatar
7 odpowiedzi
+ 2
nope
14th Jul 2016, 7:31 PM
Ashutosh Singh
0
correct
15th Jul 2016, 12:00 AM
Tijo Joseph
Tijo Joseph - avatar
0
nope
15th Jul 2016, 8:57 AM
Darren Williams
Darren Williams - avatar
0
nope
15th Jul 2016, 9:29 PM
srinivas T
srinivas T - avatar
0
result = nope as you need to use 'is' operator with null values in place of '=' to get yup
23rd Jul 2016, 4:49 PM
Saurabh Joshi
Saurabh Joshi - avatar
0
NULL means unknown. Hence two unknown NULLs can't be same/equal. The above solution provided by Saurabh Joshi is correct. I tried it myself and it works. :). Thanks. select case when null is null then 'yup' else 'nope' end as result;
25th Sep 2017, 3:56 PM
Tushar Jog
Tushar Jog - avatar
0
The null has a memory reference. So, one null value cannot be equal to another null value. See the below result: select case when null=null then 'Yes' else 'No' end as Result from dual; ================================================ Result=No
29th Oct 2017, 6:19 PM
Vinay Lonimath
Vinay Lonimath - avatar