首页 > 数据库 >Oracle 函数listagg

Oracle 函数listagg

时间:2023-02-01 16:00:52浏览次数:51  
标签:listagg 函数 sex Oracle group id select name

--可以实现将多列记录聚合为一列记录,实现数据的压缩
--基本语法:listagg(xxx,xxx) within group( order by xxx)
--select id, name, sex, score from student order by id for update;

select id, name, sex, score from student;

select name,listagg(sex||':'||score,' || ') within group( order by name) from student group by name;

 

标签:listagg,函数,sex,Oracle,group,id,select,name
From: https://www.cnblogs.com/wangrui1587165/p/17083122.html

相关文章

  • 常见非指纹built-in函数
    unescapeunescape()_函数_可对通过escape()编码的字符串进行解码。unescape("abcdefg")'abcdefg'unescape("\xa2")'¢'unescape("Vistit%20W3school%21")'Vistit......
  • oracle查看表是否被锁
    原文地址:https://www.cnblogs.com/liuzhenguo/p/12857875.html转自https://blog.csdn.net/wangchuanmei/article/details/80017108Oracle数据库操作中,我们有时会用到锁表......
  • 常见损失函数用法及其比较
    1. 损失函数损失函数(lossfunction)或代价函数(costfunction)是将随机事件或其有关随机变量的取值映射为非负实数以表示该随机事件的“风险”或“损失”的函数。在应......
  • Jmeter函数助手之__time函数
    time:有2个参数格式:非必填项,格式如果不填那么就是默认获取当前时间的毫秒数(此项也常被用于接口参数中那些不允许重复的字段);参数名称:非必填项,如果填了,则生成的时间会被放......
  • forward函数在LSTM模型中
    "forward"函数是指在LSTM(长短时记忆网络)模型中所执行的一次正向传播。在LSTM中,这个函数的作用是根据当前的输入以及之前的状态来计算当前的输出和更新网络中的隐藏状态。具......
  • Java基础系列二、代码结构+函数
    代码结构顺序结构判断结构选择结构循环结构if语句的三种格式第一种if(条件表达式){...;}...;第二种if(条件表达式){...;}else{...;}......
  • spl_autoload_register装在函数的正确写法
    AutoLoading\loading<?phpnamespaceAutoLoading;classLoadind{publicstaticfunctionautoload($className){//根据PSR-O的第4点把\转换层(目录风格......
  • php使用魔法函数和不使用魔法函数比较
    /***usemagic0.31868386268616s*notusemagic0.11876797676086s*/classTest{private$varstr="123";function__get($name){return$this->vars......
  • Swift开篇003->控制流、函数
    PART_A控制流​​for​​​​for...in​​forindexin1...5{print(index)}letnames=["cat","dog","fish"]fornameinnames{print(name)}letnums=......
  • 读Java8函数式编程笔记07_设计和架构的原则
    1. SOLID原则1.1. 开发良好面向对象程序的准则1.2. Liskovsubstitution里氏替换1.3. Interfacesegregation接口隔离1.4. Singleresponsibility单一功能原则1......