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

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -