|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 5:37 AM
Points: 581,
Visits: 303
|
|
This question is quite wrong. The SET key word can not be used by = (EqualTo operator). The correct syntax is: SET ANSI_NULLS OFF this is wrong: SET ANSI_NULLS= OFF
Deepak Kumar Sharma
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, March 03, 2011 11:52 PM
Points: 452,
Visits: 7
|
|
In the answer for this question, "The expression "MyID = NULL" evaluates to Unknown rather than any true or false condition." then y it is false... instead of unknown. can anyone pls answer this...
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:56 PM
Points: 280,
Visits: 140
|
|
peratchiselvi.m (3/23/2010) In the answer for this question, "The expression "MyID = NULL" evaluates to Unknown rather than any true or false condition." then y it is false... instead of unknown. can anyone pls answer this...
It isn't "false" it is "null" - but it will fail in a where clause or case statement because it's "not true"
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, March 03, 2011 11:52 PM
Points: 452,
Visits: 7
|
|
| s. ssc went wrong there then.... thank u...
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Thursday, May 16, 2013 3:56 PM
Points: 280,
Visits: 140
|
|
peratchiselvi.m (3/24/2010) s. ssc went wrong there then.... thank u...
No not really, it's a kind of a trick question... when you use the = operator and compare to null, the result is always unknown rather than true or false. The proper expression is "IS NULL" which will evaluate to true or false rather than unknown. That's what the question was about.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Thursday, March 03, 2011 11:52 PM
Points: 452,
Visits: 7
|
|
| ok. ok. got it....thanks.
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Today @ 3:07 PM
Points: 7,096,
Visits: 7,156
|
|
I read this question, decided it was a bit weird because where clauses don't evaluate to anything and concluded that it must be asking what truth-value/values the expression in the where clause evaluates to and ansered accordingly (UNKNOWN). The answer given as correct is FALSE. The explanation simply says that the contained expression always evaluates UNKNOWN, and doen't make any suggestion of how FALSE comes from here. I guess the author has invented a new terminology: in this new terminology a filter evaluates to something instead of including or excluding a row, and "evaluates to false" means "excludes the current row". That's not very useful, as the existing terminology makes perfect sense.
Tom Que conclure à la fin de tous mes longs propos? C'est que les préjugés sont la raison des sots. (Voltaire, 1756)
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Sunday, May 19, 2013 11:16 PM
Points: 1,061,
Visits: 1,151
|
|
easy one for NULL
|
|
|
|