listagg(colName,',') within group(order by t.colName)查询从表,在每个分组内,LISTAGG根据order by子句对列进行排序,将排序后的结果以指定字符拼接起来
select listagg(t.code_name,',') within group(order by t.code_value) as education from code_value t where t.code_type = 'AAC011'
decode(条件,值1,返回值1,值2,返回值2,…值n,返回值n,缺省值)
select floor(months_between(sysdate,to_date('1995-09-26 00:00:00','yyyy-MM-dd hh24:mi:ss'))/12) as age from dual;