oracle中的casewhen用法

oracle中的casewhen用法

ID:34724938

大小:49.14 KB

页数:5页

时间:2019-03-10

oracle中的casewhen用法_第1页
oracle中的casewhen用法_第2页
oracle中的casewhen用法_第3页
oracle中的casewhen用法_第4页
oracle中的casewhen用法_第5页
资源描述:

《oracle中的casewhen用法》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、用来在一个表中,建立多条件的提炼,非常有用。单条件的提炼函数是decode(对照值,条件1,结果1,条件2,结果2……条件N,结果N,其他)createorreplaceviewv_card_channel_count5(icpcode,sumarea,count1201,count1202,count1203,count1204,count1205,count1206,count1207,count1208,count1209,count1210,count1211,count1212,count1213,count

2、1214,count1215,count1216,count1217,count1218,count1219,count1220,count1221,count1222,count1223,count1224,count1225,count1226,count1227,count1228,count1229,count1230,count1231)asselecticpcode,'当期订购数',sum(casewhento_char(subscribe_time,'dd')='01'thensubscribe_nume

3、lse0end),sum(casewhento_char(subscribe_time,'dd')='02'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='03'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='04'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'d

4、d')='05'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='06'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='07'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='08'thensubscribe_numelse0end),sum(casewhe

5、nto_char(subscribe_time,'dd')='09'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='10'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='11'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='12'thensubscrib

6、e_numelse0end),sum(casewhento_char(subscribe_time,'dd')='13'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='14'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='15'thensubscribe_numelse0end),sum(casewhento_char(subscribe_t

7、ime,'dd')='16'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='17'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='18'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='19'thensubscribe_numelse0end),sum(c

8、asewhento_char(subscribe_time,'dd')='20'thensubscribe_numelse0end),sum(casewhento_char(subscribe_time,'dd')='21'thensubscribe_numelse0end),sum(casewhento_char(subscri

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。