复古 护眼 海天 深邃 暗黑 默认

PARSE SQL

描述

PARSE SQL 语法用于解析 SQL 并输出抽象语法树

语法

ParseSql ::=
  'PARSE' sqlStatement 

返回值说明

说明
parsed_statement 解析SQL语句类型
parsed_statement_detail 解析SQL语句细节

示例

  • 解析 SQL 并输出抽象语法树
PARSE SELECT * FROM t_order;
mysql> PARSE SELECT * FROM t_order;
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| parsed_statement     | parsed_statement_detail                                                                                                                                                                                                                                                                               |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| MySQLSelectStatement | {"projections":{"startIndex":7,"stopIndex":7,"projections":[{"startIndex":7,"stopIndex":7}],"distinctRow":false},"from":{"tableName":{"startIndex":14,"stopIndex":20,"identifier":{"value":"t_order","quoteCharacter":"NONE"}}},"parameterCount":0,"parameterMarkerSegments":[],"commentSegments":[]} |
+----------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.01 sec)

保留字

PARSE

相关链接