Is there a way to join multiple row lines a single one using two tables where the values are separated by commas in ORACLE?
Example:
Table1
IdN Name
---------
1 A
2 B
3 C
Table 2
IdC Car
------------
1 Ferrari
1 BMW
2 SEAT
2 FIAT
3 FORD
Result as:
A Ferrari,BMW
B SEAT,FIAT
C FORD
I was wondering if there is something like this:
SELECT NAME,CAR
FROM TABLE1, TABLE2
where TABLE1.IdN=TABLE2.IdC
This returns something like:
A FERRARI
A BMW
B SEAT
B FIAT
C FORD
Is there a simple way to "concat" into a row with comma-separated-values ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…