【SQL】在SQL中为decode ) )函数介绍主要作用。 将查询结果翻译为其他值(即以其他形式表示) )。
decode ) )函数的语法:
selectdecode(columnname,值1,翻译值1,值2,翻译值2,值n,翻译值n,默认值) ) From talbename Where …//判断语句selectdecode ) statuturd
decode (状态,‘01’,1,‘02’,2,0 ) :
如果字段status的值为01,则返回1,如果字段status为02,则返回2,否则返回0