ASCII Chr (9), CHR, Chr (13) usage in Oracle

Source: Internet
Author: User
Tags chr

--1 Building Table

CREATE TABLE City_table
(
City_name VARCHAR2 (100)
, District varchar2 (100)
);

--2 Inserting data

Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Dongcheng District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Xicheng ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Chongwen District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Xuanwu ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Chaoyang ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Haidian ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Fengtai ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Shijingshan ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Mentougou ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Fangshan ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Tongzhou District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Shunyi District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Changping District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Daxing District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Huairou ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Pinggu District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Miyun ');
Insert into city_table (City_name, DISTRICT) VALUES (' Beijing ', ' Yanqing County ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Hedong ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Hexi District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Nankai District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Hebei District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Hongqiao District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Tanggu District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Hangu District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Grand Port District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Dongli District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Xiqing District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Beichen District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Jinnan District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Wuqing District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Baochi District ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Jinghai County ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Ninghe County ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' Jixian ');
Insert into city_table (City_name, DISTRICT) VALUES (' Tianjin ', ' heping ');

Commit

--attack.

Select City_name,wm_concat (district| | Chr (10))
From city_table
Group BY City_name;

--the result is that the child information in it is arranged in a row (CHR), Chr (10))

Chr (9) functions as a space

ASCII Chr (9), CHR, Chr (13) usage in Oracle

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.