20, the difference oralce single and double quotes


20.1, single and double quotes oracle support, but the two are different;


20.2, acting double quotes:

1, keywords, object names, field names with double quotation marks schematic Oracle will be strictly case-sensitive, otherwise Oracl by default capitalized;


2, double quotation marks around keywords:

select "sysdate" from dual; 等同于 select sysdate from dual;

The following are not output time, output will sysdate string.

select 'sysdate' from dual;


3, double quotation marks around field names:

select * from emp where "ENAME" = scott;

Since strict double quotes prompted oracle case-sensitive, the following versa;

select * from emp where "ename" = scott;


20.3, the role of single quotes in Oracle:

1, a reference to a string constant, that is, to define the start and end of a string;

E.g:

select * from table_name where id=1123;

# This represents the query is digital

select * from table_name where id='1123';

# This is the character representing query


2, the escape character, the character appears followed (single quote) escaped

Two single quotes can be used as a single quote escape use, meaning that a real, no special features of single quotes;

E.g:

select substr('I''am a pig',1,4)










Guess you like

Origin www.cnblogs.com/LiuChang-blog/p/12315892.html