作者:瀚高PG实验室 (Highgo PG Lab)- 徐云鹤
对于换行操作,postgresql和oracle在处理方式上是有区别的。
在postgresql查询:
highgo=# select 'a''a';
?column?
----------
a'a
(1 row)
highgo=# select 'a' 'a';
错误: 语法错误 在 "'a'" 或附近的
LINE 1: select 'a' 'a';
^
highgo=# select 'a'
highgo-# 'a';
?column?
----------
aa
(1 row)
在oracle查询:
SQL> select 'a' 'a';
select 'a' 'a'
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL> select 'a' 'a' from dual;
select 'a' 'a' from dual
*
ERROR at line 1:
ORA-00923: FROM keyword not found where expected
SQL> select 'a'
2 'a' from dual;
'a' from dual
*
ERROR at line 2:
ORA-00923: FROM keyword not found where expected
SQL> select 'a''a' from dual;
'A'
---
a'a