SQL Amazing

if(0='')
print 'yes'
else
print 'no'

Result is yes

The result would be 'Yes'. "When an operator combines two expressions of different data types, the rules for data type precedence specify that the data type with the lower precedence is converted to the data type with the higher precedence" (http://msdn.microsoft.com/en-us/library/ms190309.aspx books on line). This means that the text is implicitly converted to integer with a value of 0.


Comments

Popular posts from this blog

IBM FileNet: Bulk Processing using JavaScript

ASP.NET Web API Tutorial for Beginners

DB2 Date Time Functions