# if()函数
# 判断条件是否成立
# 仅能判断一个条件
select
if(condition,'True output','False output')
from tabel
# case函数
# 可判断多个函数
select
case
when condition1 then ‘aaaa’
when condition2 then ’bbbb‘
when condition3 then ’cccc‘
else ’dddd'
end
from tabel
03-29
2795
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-19
751
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-19
549
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
08-11
316
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)