摘要:
###一、行转列listagg函数: ###场景:这里的表数据使用的是oracle默认的scott账户下的emp(员工)表。 规范写法 : LISTAGG(字段, 连接符) WITHIN GROUP (ORDER BY 字段) 通常情况下,LISTAGG是满足需要的,LISTAGG 返回的是一个va 阅读全文
摘要:
####需求,当符合条件1 修改 A表 或 新增 A表 oracle 写法 语法: merge into 目标表 a using 源表 b on(a.条件字段1=b.条件字段1 and a.条件字段2=b.条件字段2 ……) when matched then update set a.更新字段=b 阅读全文
摘要:
select * from (select * from 表名 where 条件 order by 排序日期 desc) where rownum=1; select * from (select * from TABLE where STATE = 3 order by TIME desc) wh 阅读全文