SQL> select 1 || 2 from dual;
1||2
----
12
SQL> select 1 || 'a' from dual;
1||'A'
------
1a
SQL> select 1 || "a" from dual;
ORA-00904: "a": invalid identifier
SQL> select (1 || 'a') 'c' from dual;
ORA-00923: FROM keyword not found where expected
SQL> select (1 || 'a') c from dual;
C
--
1a
SQL> select (1 || 'a') "c" from dual;
c
--
1a
代码解析:
1:oracle 中字符串连接使用单引号;
2:oracle 中字符串给连接的字符串起别名要么加双引号,要么不加;