Oracle Wm_concat () function
Oracle Wm_concat (column) functions are often used, and below teaches you how to use the Oraclewm_concat (column) function to implement field merging
Such as:
shopping: ----------------------------------------- u_id goods num ------------------------------------------ 1 Apple 2 2 Pears 5 1 &NBSP ; Watermelon 4 3 &NBSP ; Grapes 1 3 &NBSP , banana 1 1 Orange &N Bsp 3 ======================= desired results for: ------------------- ------------- u_id &nbsP goods_sum ____________________ 1 Apple, watermelon, orange 2 Pear 3 grapes, banana &NB SP;--------------------------------- select u_id, wmsys.wm_concat (goods) goods_sum from shopping GROUP BY u_id desired results 2: -------------------------------- u_id & Nbsp;goods_sum ____________________ 1 Apple (2 kg), watermelon (4 kg), Orange (3 kg) & Nbsp;2 pears (5 kg) 3 grapes (1 kg ), banana (1 kg) --------------------------------- using the Oracle Wm_concat (column) function: select u_id, Wmsys.wm_ Concat (Goods | | ' (' | | | num | | ' kg ') goods_sum from shopping GROUP by u_id
Oracle wm_concat () function