重學MySql數據庫(十八) 分支結構與循環結構總結

一. 分支結構 1. if 函數:web 功能:實現簡單雙分支 語法: if(條件,值1,值2) 位置: 能夠做爲表達式放在任何位置 2. case 結構:sql 功能:實現多分支 語法1: case 表達式或字段 when 值1 then 語句1; when 值2 then 語句2; .. else 語句n; end [case]; 語法2: case when 條件1 then 語句1;
相關文章
相關標籤/搜索