Meaning of ">" in MySQL update statement -


first things first. know ms sql server. so, hard understand mysql syntax. below statement in mysql:

insert stats_by_variantstats(variant_id, count, nonzero, sum, avg, sumsq, wavg) values(5, 1, 0, 0, 0, 0, 0) on duplicate key update         count = count + $count,         nonzero = nonzero + ($value>0),         sum = sum + $value,         avg = sum / (count + 1),         sumsq = sumsq + ($value * $value),         wavg = 0.9 * wavg + 0.1 * $value 

what meaning of ($value>0) in above statement (line: 5) following cases:

  1. $value = 0
  2. $value = 1
  3. $value = 10

thanks in anticipation.

this boolean expression. meaning identical conditional expression:

case when $value>0 1 else 0 end 

in case of update, nonzero column incremented each time $value positive.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -