Oracle Special character Query ____oracle

Source: Internet
Author: User

Oracle queries contain special characters%,_,&, and you want to query the contents of a field in a datasheet that contain this special character, you need to use the escape character, or the method of stitching the string.

0. The original data

SELECT * from t_web_groups where groupid=10088;

---------------------------------------------------------------------------
GROUPID groupname OWNER datecreated Groupcode

10088 sx&nm CV 05202367 8/17/2011 10:53:00 AM R154

---------------------------------------------------------------------------

1. Through select ASCII (' & ') from dual; You can get the ASCII code you want.

Select ASCII (' & ') from dual;

---------------------------------------------------------------------------

ASCII (' & ')
38

2. Use escape characters instead of special characters

SELECT * from t_web_groups where groupname = ' SX ' | | Chr (38) | | NM CV ';

or stitching query statements

SELECT * from t_web_groups where groupname = ' SX ' | | & ' | | ' NM CV ';

can query for success.


[Notes] special characters Insert data table (add \ Special handling)

1.insert into test values (' test\%test ');

2. Insert into test values (' Test ' test ');

3..insert into test values (' test\_test ');

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.