FORMAT SQL

Description

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

Syntax

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

Return Value Description

ColumnDescription
formatted_resultformated SQL statement

Example

  • Parse SQL and output formated 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