ci-dessous est l'obligation d'être acheived dans PL/SQL-UNPIVOT sur plusieurs colonnes pour retourner plusieurs colonnes
Le format de table est
CREATE TABLE NETWORK_TABLE (ORIG_CODE NUMBER, ORIG_SV NUMBER, DEST_CODE NUMBER, DEST_SV NUMBER)
échantillon de données -
INSERT INTO network_table VALUES (14, 1, 15, 1);
INSERT INTO network_table VALUES (18, 4, 11, 1);
INSERT INTO network_table VALUES (15, 1, 22, 3);
INSERT INTO network_table VALUES (23, 2, 21, 1);
INSERT INTO network_table VALUES (14, 3, 11, 1);
INSERT INTO network_table VALUES (12, 2, 22, 2);
Tableau des données ressemble à -
Orig_r orig_sv dest_r dest_sv
14 1 15 1
12 2 22 2
18 4 11 1
15 1 22 3
14 3 11 1
Maintenant, je veux obtenir la sortie comme ci-dessous -
ROOT SV
14 1
15 1
12 2
22 2
18 4
11 1
15 1
22 3
14 3
1 1
Comment puis-je acheive cela? Apprécions vos commentaires
Parfait! Merci – Silpa