In the oracle statement, the values of a column are combined into one value, separated by commas

1. All versions of Oracle can use the wm_concat() function:

SELECT pos_preeqid,wmsys.wm_concat(to_char(wkid)) FROM worker where pos_preeqid=62 and wkid<40000 GROUP BY pos_preeqid;

2. If it is 11g, use the listagg() within group() function:

SELECT pos_preeqid, ListAgg(to_char(wkid),',') WITHIN GROUP(ORDER BY pos_preeqid) AS xCity FROM worker where pos_preeqid=62 and wkid<40000 GROUP BY pos_preeqid;

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324098191&siteId=291194637