Method, system, program, and data structure for pivoting columns in a database table
AssigneeInternational Business Machines Corporation
InventorsMark Anthony Cesare, Julie Ann Jerves, Richard Henry Mandel, III
Life of this patent
Estimating the term…
Abstract
Disclosed is a method, system, program, and data structure for transforming at least one column in a database input table. An input data table has multiple columns and rows. A determination is made of multiple data column names and multiple pivot columns in the input table. A row is generated in an output table for each data column name, having one data column name field including one data column name and at least one pivot column field including the value in one pivot column field in the input table, wherein each of the rows in the output table for each data column name has different values in at least one of the data column name field and pivot column field.
Claims32
A method for transforming at least two columns in an input table, comprising:
- determining an input data table comprised of multiple columns and rows;
- determining multiple data column names;
- determining multiple pivot columns in the input table;
- and
- generating a row in an output table for each data column name and for each pivot column value in each pivot column, having one data column name field including one data column name and at least one pivot column field including the value in one pivot column in the input table, wherein each of the rows in the output table for each data column name has different values in at least one of the data column name field and pivot column field.
A system for transforming at least two columns in an input table, comprising:
- means for determining an input data table comprised of multiple columns and rows;
- means for determining multiple data column names;
- means for determining multiple pivot columns in the input table;
- and
- means for generating a row in an output table for each data column name and for each pivot column value in each pivot column, having one data column name field including one data column name and at least one pivot column field including the value in one pivot column in the input table, wherein each of the rows in the output table for each data column name has different values in at least one of the data column name field and pivot column field.
An article of manufacture for use in transforming at least two columns in an input table, the article of manufacture comprising computer usable media including at least one computer program embedded therein that causes the computer to perform:
- determining an input data table comprised of multiple columns and rows;
- determining multiple data column names;
- determining multiple pivot columns in the input table;
- and
- generating a row in an output table for each data column name and for each pivot column value in each pivot column, having one data column name field including one data column name and at least one pivot column field including the value in one pivot column in the input table, wherein each of the rows in the output table for each data column name has different values in at least one of the data column name field and pivot column field.
A memory device including a command for performing a pivot operation on a computer database input table, the command comprising
- an input data table name parameter indicating the input table comprised of multiple columns and rows subject to the pivot operation;
- and
- a data column parameter indicating multiple data column names;
- a pivot column parameter indicating multiple pivot columns in the input table, wherein a row is generated in an output table for each data column name and for each pivot column value in each pivot column, having one data column name field including one data column name and at least one pivot column field including the value in at least one of the pivot column in the input table.
Dependencies are inferred from the claim text.