Home > database >  Oracle one-to-many queries
Oracle one-to-many queries

Time:09-28

Problem a: a table field id, name, table b field ids, realid, two table id related table a id corresponding to multiple realid in table b, how to make the check out of the results for a.n ame, Anderson d, col, the col b a table for many parts, comma separated value, example: a.n ame=students, Anderson d=1, col=4 and 6, the id of a table for the corresponding table realid b=4, 1 realid=5, realid=6, request can use PLSQL query and export to Excel,
Question 2: how to use PLSQL derived data types for

CodePudding user response:

Select id, wmsys. Wm_concat (realid) realids from group b by id.

CodePudding user response:

Oracle is 12 with
Listagg (realid that ', ') wtihin group (order by id)
  • Related