oracle+列合并一行

@丰治6839:oracle怎么把多个列(字段)合并成一列.把下面的日期合并在一起 -
阴怖18781351227…… 是不是要把三个date放一列,三个ru放一列,一共组合成两列: select date_a, ru_a from table union all select date_b, ru_b from table union all select date_c, ru_c from table

@丰治6839:在Oracle中,如何将多行数据合并成一行数据,如下: -
阴怖18781351227…… 如果这两行有个共同的其他列作为分组,标志他们是同一组、比如姓名编号之类的,是可以group by后min出来的. select 姓名,min(引流管) as 引流管,min(化疗) as 化疗, min(放疗) as 放疗 from 记录表 group by 姓名 ;

@丰治6839:oracle怎样将多列转换成一行? -
阴怖18781351227…… 用 WM_CONCAT() 函数

@丰治6839:oracle 怎么将同一行2列显示在一起 -
阴怖18781351227…… 要将几列合并到一列显示,有几个问题需要考虑1) 不同数据类型之间是否能够互相转换,比如 number 类型可以转换为varchar2,但是varchar2不一定能转成number类型,因为如果有非数字的字符,肯定会出错2) long, clob, blob等 大文本/二进制类型的列肯定不能合并,只能通过自己写sql 调用数据库自带的存储过程或者包来实现就你的例子而言一楼的实现可行.

@丰治6839:Oracle中多行合并为一列,具体内容请看问题补充,谢谢 -
阴怖18781351227…… select name,case when course='语文' then course end course1,case when course='语文' then score end score1,case when course='数学' then course end course2,case when course='数学' then score end score2,case when course='英语' then course end course3,case when course='英语' then score end score3 from mytable group by name

@丰治6839:如何将Oracle一列数据转成一行 -
阴怖18781351227…… select listagg(COLUMN,',') within GROUP (order by COLUMN) from table_name (11g之后的函数) 或者 select wm_concat(COLUMN) from table_name

@丰治6839:oracle中多行合并到一行 -
阴怖18781351227…… select max(A), max(b), max(c), max(d), max(e)from t

@丰治6839:oracle 怎么实现: A列 B列 a1 b1 a2 b2 a3 b3 合并成一段: a1+b1+a2+b2+a3+b3 -
阴怖18781351227…… declare v_str varchar2(2000):=''; --如果记录数很多这种方法不适用 cursor cc is select A列,B列 from 表 order by A列; v cc%rowtype; begin open cc; loop fetch cc into v; exit when cc%NOTFOUND; v_str:=v_str||v.A列||v.B列; end loop; close cc; dbms_output.out_line(v_str); end;

@丰治6839:在oracle中使用cursor合并多行数据 -
阴怖18781351227…… SQL> create table idtable (id number,name varchar2(30)); Table created SQL> insert into idtable values(10,'ab');1 row inserted SQL> insert into idtable values(10,'bc');1 row inserted SQL> insert into idtable values(10,'cd');1 row inserted SQL> ...

@丰治6839:oracle 把同一列 显示到同一行 -
阴怖18781351227…… 你试一下,一定可以select a,WM_CONCAT(b),sum(c) from (select a,b,sum(c) c where 表 group by a,b) group by a

相关推荐

  • oracle一条转成多列
  • oracle多行合并成一行
  • oracle wm concat
  • oracle create table like
  • 多行合并一行保留内容
  • excel两行合并一行
  • oracle一行拆成多行
  • oracle逗号分割转多行
  • oracle竖列的数据变成一行
  • oracle 逗号分隔转多行
  • oracle 分组合并多行结果
  • oracle拆分字段为多行
  • sql一对多 合并成一行
  • oracle多列合并成一列
  • oracle多列转成一行
  • oracle列转行
  • oracle合并多行为一列
  • sql实现多行合并一行
  • oracle一行拆分成多行
  • oracle在指定列后添加列
  • oracle取最大值那一行
  • oracle多行转单行多列
  • excel三行合并一行
  • oracle根据逗号一行变多行
  • 多行合并一行
  • oracle取某字段最大值的行
  • 本文由网友投稿,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
    若有什么问题请联系我们
    2024© 客安网