Home > Database > Mysql Tutorial > oracle里面如何写case语句

oracle里面如何写case语句

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:21:50
Original
1177 people have browsed it

select logid,userid,logtime,url,description, (case operatetype when operatetype = 0 then 新增 when operatetype=1 then 修改 else 删除 end case) from log ???? 1. case select logid,userid,logtime,url,description,( case when operatetype = 0 th

   select logid,userid,logtime,url,description, (case operatetype when operatetype = 0 then ’新增’ when operatetype=1 then ’修改’ else ’删除’ end case) from log ????

  1. case

  select logid,userid,logtime,url,description,(

  case

  when operatetype = 0

  then ’新增’

  when operatetype=1

  then ’修改’

  else ’删除’

  end ) from log

  2.decode的写法:

  select logid,userid,logtime,url,description,

  decode(operatetype,0,’新增’,1,’修改’,’删除’) operationname

  from log

  建议用decode的写法

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template