mysql中的case语句
1。
selectname,
case
whenbirthday<'1981'then'old'
whenbirthday>'1988'then'yong'
else'ok'ENDYORN
fromlee;
2。
selectNAME,
casename
when'sam'then'yong'
when'lee'then'handsome'
else'good'end
fromlee;
当然了casewhen语句还可以复合
3。
selectname,birthday,
case
whenbirthday>'1983'then'yong'
whenname='lee'then'handsome'
else'justsoso'end
fromlee;
更多的可以参考http://www.cnblogs.com/tillere007/archive/2010/05/25/1743210.html
相关推荐
CoderToy 2020-11-16
emmm00 2020-11-17
王艺强 2020-11-17
ribavnu 2020-11-16
bianruifeng 2020-11-16
wangshuangbao 2020-11-13
苏康申 2020-11-13
vivenwan 2020-11-13
moyekongling 2020-11-13
云中舞步 2020-11-12
要啥自行车一把梭 2020-11-12
aydh 2020-11-12
kuwoyinlehe 2020-11-12
minerk 2020-11-12
vitasfly 2020-11-12
jazywoo在路上 2020-11-11
敏敏张 2020-11-11
世樹 2020-11-11