In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.