In Oracle möchte ich Kind zu niedrigsten Elternwert zu füllen.
die Abfrage und führen
Wie fülle ich den gleichen Wert mit Kind Zeile
query: SELECT col1, col2 FROM DATA
Ergebnis:
+-----------+------+
| col1 | col2 |
+-----------+------+
| 001 | a |
| 001001 | b |
| 001002 | c |
| 001003 | d |
| 001003001 | e |
| 001003002 | f |
| 002 | g |
| 003 | h |
| 003001 | i |
| 003002 | j |
+-----------+------+
col1 Schlüssel. und Kind-Index haben Eltern-Index.
Ich möchte dieses Ergebnis machen
+------+------+------+------+
| col1 | col2 | col3 | col4 |
+------+------+------+------+
| a | b | b | b |
| a | c | c | c |
| a | d | e | e |
| a | d | f | f |
| g | g | g | g |
| h | i | i | i |
| h | j | j | j |
+------+------+------+------+
wenn Eltern kein Kind haben, Kind Spalten Eltern füllen.
wie kann ich dieses ergebnis machen? ...
danke.
Ihnen danken. Ich lerne "Rekursive Unterabfrage-Factoring" von Ihnen –