Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the LISTAGG function

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces "how to use LISTAGG function". In daily operation, I believe many people have doubts about how to use LISTAGG function. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts about "how to use LISTAGG function". Next, please follow the editor to study!

LISTAGG function Oracle 11.2: string aggregation

String aggregation is to concatenate multiple rows of data into one line by grouping, taking the following result set as an example:

11.2 there are WMSYS.WM_CONCAT functions before, but they are not documented.

Two rows of sons

To achieve this, different rows of the same category can be displayed on a single line, using the

Wmsys.wm_concat (a.FAILURE_DESC | |'-'| | a.FAILURE_QTY)

Or

LISTAGG (a.FAILURE_DESC | |'-'| | a.FAILURE_QTY) WITHIN GROUP (ORDER BY NULL)

Select a.shift, a.work_order, a.machineid, a.date_work, a.part_name, a.model_name,a.CUSTOMER_NAME

A.model_serial, a.QTY topical char (wmsys.wm_concat (a.FAILURE_DESC | |'-'| | a.FAILURE_QTY)) from (

SELECT a.shift, a.work_order, a.machineid, a.date_work, a.part_name, a.model_name,a.CUSTOMER_NAME

A.model_serial, SUM (a.pass_qty) QTY,b.FAILURE_DESC,b.FAILURE_QTY

FROM (SELECT a.shift, a.work_order, a.machineidrecoveryc.customer _ name

CASE WHEN a.shift ='N' AND a.time_section 8

AND time_section 8 AND time_section 8

AND time_section='20130101' and a.DATE_WORK

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report