FORMAT SQL

Description

The FORMAT SQL syntax is used to parse SQL and output formatted SQL statement.

Syntax

Grammar Railroad diagram

  1. ParseSql ::=
  2. 'FORMAT' sqlStatement

Return Value Description

ColumnDescription
formatted_resultformatted SQL statement

Example

  • Parse SQL and output formatted SQL statement
  1. FORMAT SELECT * FROM t_order;
  1. mysql> FORMAT SELECT * FROM t_order;
  2. +-------------------------+
  3. | formatted_result |
  4. +-------------------------+
  5. | SELECT *
  6. FROM t_order; |
  7. +-------------------------+
  8. 1 row in set (0.00 sec)

Reserved word

FORMAT