title: Computing value in select statement t-sql
body: <p>I am trying to compute a value in select statement itself but surprisingly it results in 0.</p>
  
  <pre><code>SELECT Top(1) Name, 
  LEN(Name) AS Equals, 
  Abs(LEN('Johny') - LEN(Name)) AS NotEquals, 
  LEN(Name)/(Abs(LEN('Johny') - LEN(Name)) + LEN(Name)) As Match
  FROM Demo
  WHERE Name = LEFT( 'Johny' , LEN(Name) ) 
  ORDER BY LEN(Name) DESC 
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>Name    Equals  NotEquals   Match
  John    4           1         0
  </code></pre>
  
  <p>Why exactly is value of <code>match</code> field <code>0</code> in output?</p>