zoukankan      html  css  js  c++  java
  • Kettle行列转换

    Kettle在控件中拥有行列转换功能,但是行列转换貌似是弄反了。

    一.行转列

    1.数据库脚本

    create TABLE StudentInfo
    (
        studentno int,
        subject varchar(10),
        grade int 
    );
    insert into StudentInfo values(201105545,'语文',80); insert into StudentInfo values(201105545,'数学',82); insert into StudentInfo values(201105545,'英语',84); insert into StudentInfo values(201105543,'语文',70); insert into StudentInfo values(201105543,'数学',74); insert into StudentInfo values(201105543,'英语',76); insert into StudentInfo values(201105548,'语文',90); insert into StudentInfo values(201105548,'数学',93); insert into StudentInfo values(201105548,'英语',94); commit;

    2.总体行转列示意图

    2.1表输入配置

    2.2列转行配置

     

    2.3字段选择配置

    2.4文本文件输出配置

    输出到文件后查看内容

    二.列转行

    1.数据库脚本

    CREATE TABLE StudentInfo_TMP(studentno INT,Chinese INT,Math INT,English int);
    
    INSERT INTO StudentInfo_TMP VALUES(201105543,70,74,76);
    
    INSERT INTO StudentInfo_TMP VALUES(201105545,80,82,84);
    
    INSERT INTO StudentInfo_TMP VALUES(201105548,90,93,94);

    2.整体示意图

    2.1表输入

    2.2行转列

     

    2.3字段选择

    2.4文本文件输出

    3.执行后查看输出文本文件

  • 相关阅读:
    作业: 小型购物系统1---按顺序编写
    字典操作学习小结
    字符操作学习笔记小结
    列表,元组等学习笔记小结
    模块及其数据类型小结
    python3学习笔记----基础知识1
    压力山大
    下周一开始上班啦!
    凌晨12点,沉迷学习,无法自拔...
    web前端开发2018年12月找工作总结
  • 原文地址:https://www.cnblogs.com/OliverQin/p/5871330.html
Copyright © 2011-2022 走看看