摘要: --Oracle列转行函数LISTAGG() with tb_temp as( select 'China' 国家,'Wuhan' 城市 from dual union all select 'China' 国家,'Dongjing' 城市 from dual union all select 'China' 国家,'Xijing' 城市 from dual union all ... 阅读全文
posted @ 2018-11-21 20:43 学亮编程手记 阅读(559) 评论(0) 推荐(0) 编辑
摘要: --decode条件判断函数 select decode(100,150,200,300,400,-1) from dual --需求:不通过连表查询,显示业主类型名称列的值 select name,decode(ownertypeid,1,'居民',2,'事业单位',3,'商业','其他') from t_owners --case when then写法 select name,( ... 阅读全文
posted @ 2018-11-21 20:23 学亮编程手记 阅读(4553) 评论(0) 推荐(0) 编辑
摘要: --NVL空值处理函数 --需求:显示价格表中业主类型ID为1的价格记录 如果上限值为null,则显示9999999 select nvl(null,0) from dual; select * from t_pricetable select nvl(maxnum,9999999) from t_pricetable where ownertypeid=1; --NVL2函数 select ... 阅读全文
posted @ 2018-11-21 20:09 学亮编程手记 阅读(486) 评论(0) 推荐(0) 编辑