Oracle Wm_concat () function

Source: Internet
Author: User
Tags pears

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.