You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/06/10 01:39:11 UTC

[GitHub] [flink] RocMarshal commented on a change in pull request #16126: [FLINK-22934][docs] Add instructions for using the " ' " escape syntax of SQL client

RocMarshal commented on a change in pull request #16126:
URL: https://github.com/apache/flink/pull/16126#discussion_r648789706



##########
File path: docs/content.zh/docs/dev/table/sqlClient.md
##########
@@ -153,6 +153,37 @@ Received a total of 5 rows
 
 定义查询语句后,可以将其作为长时间运行的独立 Flink 作业提交给集群。[配置部分](#configuration)解释如何声明读取数据的 table source,写入数据的 sink 以及配置其他表程序属性的方法。
 
+### SQL Client CLI 中的转义语法
+
+在 SQL 中,使用单引号来转义单引号。因此,如果你想在一个字符串常量中指定单引号,那么你应该使用两个单引号(不是双引号)。
+例如,有表 `t` 如下所示:
+
+```text
++--------+-----+
+|  name  | cnt |
++--------+-----+
+| n'ame1 |   1 |
+| name2  |   2 |
++--------+-----+
+2 rows in set
+```
+
+为了查询出 name 列值为 `"n'ame1"` 的记录,你应该使用:
+
+```sql
+select * from t where name='n''ame1'
+-- or

Review comment:
       ```suggestion
   -- 或者
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org