Oracle one-to-many organize multiple rows of data into one row

Source: Internet
Author: User

A one-to-many relationship in development is often used, and yesterday a customer problem was asked to organize the information for all feedback tasks into a single line to show and export Excel.

My database correspondence: The feedback task task corresponds to multiple feedback, which means that each task has a lot of feedback cycles. Requires crawling of all feedback information for each task.

Task table:

Feedback table:

Use the Wmsys.wm_concat function for processing:

Select Task_id,wmsys.wm_concat (T.CONTENTSS) as contentsum from Zx_gzdb_feedback t where task_id = ' 201706261036120392116914415206 ' GROUP by task_id;

Output Result:

Oracle one-to-many organize multiple rows of data into one row

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.