Data cleansing note (14): usage not noticed by rtrim _ MySQL

Source: Internet
Author: User
Tags rtrim
[Background] in the business logic, data of a field needs to be processed. it is required that the data starting from the right side should be removed from the data starting from the first place and being 0 in a row. We get used to using the rtrim function to process spaces at the beginning of the right, but ignore that this function can actually remove a specific number. [background]
In the business logic, the data of a field needs to be processed. it is required that the data starting from the right side should be removed from the data starting from the first, and the data starting from 0 in a row should be removed from the data. We get used to using the rtrim function to process spaces at the beginning of the right, but ignore that this function can actually remove specific numbers or characters.

[Solution]
Use the rtrim function to remove a number or character starting from the first position on the right.

[Experiment]
1. example: Use the rtrim function to remove consecutive spaces starting from the first place on the right.

SELECT RTRIM('232388    ')||RTRIM('2312323    ') FROM DUAL;


SELECT ('20140901') "| ('20140901') from dual;

2. example: Use the rtrim function to remove a consecutive "character" or "number" starting from the first place on the right"

SELECT ('232388aaaaa')||('2312323bbbbb') FROM DUAL;

SELECT RTRIM('232388aaaaa','a')||RTRIM('2312323bbbbb','b') FROM DUAL;

Small knowledge, easy to remember.

Blue Growth series:

Original works, from "Deep Blue blog" blog

Blue Growth note-chasing DBA (1): traveling on the road to Shandong

Blue Growth notes-Chase DBA (2): Install! Install! Long-lost memories have aroused my new awareness of DBAs.

Blue Growth note-chasing DBA (3): importing and exporting data on antiques becomes a problem

Blue Growth note-chasing DBA (4): recalling the sorrow of teenagers, and then exploring oracle installation

Blue Growth note-chasing DBA (5): not talking about technology or business, annoying application systems

Blue Growth note-chasing DBA (6): doing things and being human: small technology, great human

Blue Growth note-Chase DBA (7): Basic commands, foundation stone

Blue Growth notes-chasing DBA (8): repicking SP reports and recalling oracle's STATSPACK experiment

Blue Growth note-chasing DBA (9): chasing DBA, new planning, new departure

Blue Growth note-chasing DBA (10): Flying Knife Defense, familiarity rather than expertise: Playing with middleware Websphere

Blue Growth note-chasing DBA (11): It's easy to go home and wake up.

Blue Growth notes-Chase DBA (12): seven days and seven gains of SQL

Blue Growth note-chasing DBA (13): coordinating hardware manufacturers, six stories: What you see as "servers, storage, switches ......"

Blue Growth note-chasing DBA (14): an unforgettable "cloud" end, started hadoop deployment

Blue Growth note-chasing DBA (15): Who thinks FTP is "simple" and thinks it is a trigger

Blue Growth note-chasing DBA (16): DBA also drank alcohol and was rejected

Blue Growth note-Chase DBA (17): whether to share or consume, learn to grow in the post-IOE era

Blue Growth note-Chase DBA (18): a was Cluster failure on a small machine caused by an IP address change

Blue Growth note-chasing DBA (19): an episode on the road: touching the "framework" and "software system"

Blue Growth note-chasing DBA (20): Why did it come from? database creation escort

Other chapters:

Football and oracle series (1): 32-way zhoudianbing, overall view of Group A Brazil SMON process of oracle32 process Alliance

Football and oracle series (2)

Football and oracle series (3): oracle process rankings, the World Cup round is about to fight!

Football and oracle series (4): From Brazil to Germany, think of the different RAC topology comparison!

Football and oracle series (5): The directX Library missing in the voda14 game is similar to the oracle rpm Package!

Football and oracle series (6): Asian Cup with database creation-come on, Chinese team

The above is the data cleansing note (14): The usage of rtrim is not noticed _ MySQL content. For more information, please follow the PHP Chinese network (www.php1.cn )!

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.