色婷婷狠狠18禁久久YY,CHINESE性内射高清国产,国产女人18毛片水真多1,国产AV在线观看

sql中的if判斷語句應(yīng)該怎么寫

林國瑞2年前17瀏覽0評論

sql中的if判斷語句應(yīng)該怎么寫?

語義上是按書寫的從前到后順序匹配的。參考sql 2006標(biāo)準(zhǔn)的Part 2: Foundation (SQL/Foundation)的6.11 <case expression>:

2) Case:a) If the value of the <search condition> of some <searched when clause> in a <case specification> is True, then the value of the <case specification> is the value of the <result> of the first (leftmost) <searched when clause> whose <search condition> evaluates to True, cast as the declared type of the <case specification>.b) If no <search condition> in a <case specification> evaluates to True, then the value of the <case expression> is the value of the <result> of the explicit or implicit <else clause>, cast as the declared type of the <case specification>.

當(dāng)然優(yōu)化器有可能可以嘗試分析when的條件是否互斥,如果互斥而且無副作用的話可以任意調(diào)整順序,不過表面上展現(xiàn)的語義仍然跟從前到后順序匹配是一樣的。所以從使用的角度看就只認(rèn)順序匹配就對了。