wm_concat(字段) 内容列显示 变成行显示
substr(字段,number)
trunc(字段,number)number为空截取全部小数,不四舍五入,限定小数的位数
instr(‘abc’,’a’);表示在abc中查找有没有a这个字符。
select ceil(9.5) from dual union select floor(9.5) from dual;
结果为:9
10
--1
select year,wm_concat(amount) from test group by year
结果为:
——————————————————————
|year | --- |
|2015 | 1.1,1.2,1.3 |
|2016 | 1.1,1.2,1.3 |
——————————————————————
--2
select year,substr(wm_concat(amount),1,3) m1,substr(wm_concat(amount),-7,3) m1,substr(wm_concat(amount),-3) m1 from test group by year
————————————————————————
|year | m1 | m2 | m3 |
|2015 | 1.1 |1.2 | 1.3 |
|2016 | 1.1 |1.2 | 1.3 |
————————————————————————