In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Method 1: through the wm_concat function, this function can be used in 10g, not compatible in 11g, removed from 12g, and the return type is varchar.
Syntax: wm_concat (column)
Example: Select wm_concat (Rownum) From dual Connect By Rownum < 10
Advantages: simple syntax
Disadvantages: character length can not exceed 4000, separated by commas, if you want to be separated by other symbols, but also replace, the performance is relatively poor
Method 2: through lisagg, the return type is varchar
Syntax: listagg (parameter, 'delimiter') within group (order by parameter id)
Example: Select
Listagg (Rownum,';') Within group (Order By Rownum Desc)
From dual Connect By Rownum < 10
Advantages: it can be sorted, and the delimiters can be customized, and it is efficient.
Disadvantages: the length of stitching characters cannot exceed 4000
Method 3: through xmlagg, it is used to parse MXL, or it can be used as character concatenation to return the clob type.
Syntax:
XMLAGG (XMLPARSE (CONTENT field | | WELLFORMED) ORDER BY field) .GETCLOBVAL ()
Or
XMLAGG (XMLELEMENT (e, string, delimiter) .Extract ('/ / text ()') .GETCLOBVAL ()
Example:
You can use either of the following:
Select Xmlagg (Xmlparse (Content Rownum | |', 'Wellformed) Order By Rownum Desc)
.Getclobval ()
From Dual
Connect By Rownum < 30000
Select Xmlagg (Xmlelement (e, Rownum,','). Extract ('/ / text ()') .Getclobval ()
From Dual
Connect By Rownum < 30
Advantages: there is no length limit for character stitching
Disadvantages: syntax is complex.
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.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.