The Oracle database stitching the values of a column into one row, separated by commas between the values

Source: Internet
Author: User

Use scenario: Convert a column value to a comma-delimited string

Example: For example, query all of the table space below, now to get all the table space with a comma-delimited string (such as the time of Rman duplicate skip tablespace)

SQL>Select from v$tablespace;name--------------------------- ---systemsysauxctxdapps_ts_tx_dataapps_ts_tx_idxowapubapps_ts_queuesodmolapapps_ts_toolsapps_ts_ Seedapps_ts_interfaceapps_ts_mediaxxcusapps_undots1apps_ts_summaryapps_ts_nologgingxxapexportalapps_ts_ Archivetemp1mesapps_queryxxapsxxagilexxbixxocsxxoa rows selected.

Solution: Wmsys.wm_concat () stitching fields separated by commas

SQL>Selectfrom  v$tablespace; Wmsys. Wm_concat (NAME)----------------------------------------------------------------------------- ---system,sysaux,ctxd,apps_ts_tx_data,apps_ts_tx_idx,owapub,apps_ts_queues,odm,olap,apps_ts_tools, Apps_ts_seed,apps_ts_interface,apps_ts_media,xxcus,apps_undots1,apps_ts_summary,apps_ts_nologging,xxapex, Portal,apps_ts_archive,temp1,mes,apps_query,xxaps,xxagile,xxbi,xxocs,xxoa

The Oracle database stitching the values of a column into one row, separated by commas between the values

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.