随笔分类 - sql
世界可以没有python ;
但是不能没有sql
摘要:将table_1表中的数据,每个area的每个atype为A、B、C、D的数量统计出来。 重要的点: 1)pivot()里面for前面必须用聚合函数; 2)m字表中的每个字段都会在查询结果里面; ``` select * from (select area,atype from table_1) m
阅读全文
摘要:select atype,name_list from ( select listagg(aname,',') within group( order by atype) name_list ,atype from listtable where age>0 group by atype) a; /
阅读全文
摘要:select regexp_substr(t.mywords , '[^,]+', 1, rownum,'i'), myid from (select myid,mywords from tablename where myid='12345') t connect by rownum <= LEN
阅读全文

浙公网安备 33010602011771号