Home>
When outputting a table like the image below, I would like to output it in SQL instead of doing a muddy work in Excel.
Thanks for your teaching.
<DDL>
CREATE TABLE Bunseki
(
nengetsu CHAR (6) NOT NULL,
name CHAR (3) NOT NULL,
rank1 CHAR (2) NOT NULL,
rank2 CHAR (2),
kosu number);
<INSERT>
INSERT INTO Bunseki VALUES ('201904', 'AAA', '01', '04', 1);
INSERT INTO Bunseki VALUES ('201904', 'AAA', '02', '04', 2);
INSERT INTO Bunseki VALUES ('201904', 'AAA', '03', '04', 3);
INSERT INTO Bunseki VALUES ('201904', 'AAA', '04', '04', 3);
INSERT INTO Bunseki VALUES ('201905', 'AAA', '05', '09', 4);
INSERT INTO Bunseki VALUES ('201905', 'AAA', '06', '09', 5);
INSERT INTO Bunseki VALUES ('201905', 'AAA', '07', '09', 6);
INSERT INTO Bunseki VALUES ('201905', 'AAA', '08', '09', 7);
Execute it with sqlplus, for the time being possible with SQL.
To bring the rank total to the right, you need PL/SQL that can be edited more freely.