Two notable special symbols in SQL

Source: Internet
Author: User
In SQL, it is strongly recommended to use single quotes (') in quotation marks that represent strings. Although MySQL can also use double quotes ("), it is recommended that you use single quotes in order to be consistent with SQL Server and Oracle. If you have single quotes in the string, you need to replace them with two single quotes (' ") in SQL, which the DBMS interprets as a single quote.
The newline and string connectors for SQL are different in MySQL, SQL Server, and Oracle, as shown in the list below. Mysqlsql serveroracle newline character \ n or \ r \ n or char (a) char (10) string Connector concat () +| | or concat ()
In addition, the symbol (&) has a special meaning in Oracle, a macro variable identifier that executes the select ' AAA ' as STR from DUAL in Sqlplus, and it prompts you to enter the value of the macro variable, all if there is (&) in the SQL, It is recommended to enclose in single quotes such as select ' AAA ' | | ' & ' | | ' nbsp BBB ' as STR from dual it won't prompt.
Personal little Summary to remember.


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.