SELECT col1, col2,
CASE
WHEN col3 > 1 AND col3 <2
THEN '1'
WHEN col3 > 2 AND col3 <3
THEN '2'
WHEN col3 > 3 AND col3 <4
THEN '3'
ELSE '4'
END mylevel
FROM table
select case
when nsrsbh='330165737758262' then nsrsbh
when nsrsbh='330106745808709' then nsrsbh
else '99999'
end
from WS_TDS_SQ
select case nsrsbh
when '330165737758262' then nsrsbh
when '330106745808709' then nsrsbh
else '99999'
end
from table
decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值)
decode(字段或字段的运算,值1,值2,值3)
select decode (value, <if this value>, <return this value>) FROM table
select decode(col1,'330165737758262',nsrsbh,'330106745808709',nsrsbh,0) from table
select decode(col1,'330165737758262','6','9') from table
相关推荐
第16章 DECODE和CASE SQL中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 Oracle基本安全 第Ⅲ部分 高级内容 第19章 高级安全性—— 虚拟专用数据库 第20章 使用表空间 第21章 用SQL*Loader...
原书名: Oracle Database 11g The Complete Reference 原出版社: McGraw-Hill Osborne Media ... 第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区
原书名: Oracle Database 11g The Complete Reference 原出版社: McGraw-Hill Osborne Media ... 第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区
第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区 . 第19章 oracle 基本安全 第ⅲ部分 高 级 主 题 第20章 高级安全性——虚拟专用数据库 第21章 ...
基本信息 原书名: Oracle Database 11g The Complete Reference 原出版社: McGraw-Hill Osborne ... 第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区
原书名: Oracle Database 11g The Complete Reference 原出版社: McGraw-Hill Osborne Media ... 第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区
第16章 DECODE和CASE.SQL中的if-fhen-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区 第19章 Oracle基本安全 第Ⅲ部分 高级主题 第20章 高级安全性-虚拟专用数据库 第21章 高级安全性:透明数据加密...
第16章 DECODE和CASE.SQL中的if-fhen-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区 第19章 Oracle基本安全 第Ⅲ部分 高级主题 第20章 高级安全性-虚拟专用数据库 第21章 高级安全性:透明数据加密...
第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区 . 第19章 oracle 基本安全 第ⅲ部分 高 级 主 题 第20章 高级安全性——虚拟专用数据库 第21章 ...
第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区 . 第19章 oracle 基本安全 第ⅲ部分 高 级 主 题 第20章 高级安全性——虚拟专用数据库 第21章 ...
原书名: Oracle Database 11g The Complete Reference 原出版社: McGraw-Hill Osborne Media ... 第16章 decode 和case:sql中的if-then-else 第17章 创建和管理表、视图、索引、群集和序列 第18章 分区
代码如下: — 获取上旬开始... select case decode(trunc((to_char(v_rq, ‘dd’) – 1) / 10), 0, ‘上旬’, 1, ‘中旬’, ‘下旬’) when ‘上旬’ then –返回上个月的下旬 to_char(add_months(v_rq, -1), ‘yyyyMM
sql> alter index xay_id allocate extent(size 200k datafile \'c:/oracle/index.dbf\'); <8>.alter index xay_id deallocate unused; 、查看索引 SQL>select index_name,index_type,table_name from user...
create tablespace TS_DJY datafile 'd:/software/oracle/tablespace/ts_djy.dat' size 1024M autoextend on next 100M maxsize 2048M; 2.1.1.2 指定用户表空间 alter user cssdj default tablespace TS_DJY; 2.1....