mysql - Why does UPDATE x SET y='c' AND TRUE result in y='0' -


i'm playing around sql challenge , noticed given table x single text column y following query:

update x set y='c' , true

results in y='0'

also:

update x set y='c' or true

results in y='1'

out of curiosity i'm trying understand what's happening underneath produce these results.

expressions y='c' , true , y='c' or true boolean expressions. evaluate either 1 when expression true, or 0, when expression false.

your update evaluates these expressions, , stores results in field y.


Comments

Popular posts from this blog

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -