<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="create-table-generated-columns">
      </a>
      15.1.20.8 CREATE TABLE and Generated Columns
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045184799888">
  </a>
  <p>
   <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
    <code class="literal">
     CREATE TABLE
    </code>
   </a>
   supports the
        specification of generated columns. Values of a generated column
        are computed from an expression included in the column
        definition.
  </p>
  <p>
   Generated columns are also supported by the
   <a class="link" href="mysql-cluster.html" title="Chapter 25 MySQL NDB Cluster 8.4">
    <code class="literal">
     NDB
    </code>
   </a>
   storage engine.
  </p>
  <p>
   The following simple example shows a table that stores the
        lengths of the sides of right triangles in the
   <code class="literal">
    sidea
   </code>
   and
   <code class="literal">
    sideb
   </code>
   columns,
        and computes the length of the hypotenuse in
   <code class="literal">
    sidec
   </code>
   (the square root of the sums of the
        squares of the other sides):
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21017922"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> triangle <span class="token punctuation">(</span>
  sidea <span class="token datatype">DOUBLE</span><span class="token punctuation">,</span>
  sideb <span class="token datatype">DOUBLE</span><span class="token punctuation">,</span>
  sidec <span class="token datatype">DOUBLE</span> <span class="token keyword">AS</span> <span class="token punctuation">(</span><span class="token function">SQRT</span><span class="token punctuation">(</span>sidea <span class="token operator">*</span> sidea <span class="token operator">+</span> sideb <span class="token operator">*</span> sideb<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> triangle <span class="token punctuation">(</span>sidea<span class="token punctuation">,</span> sideb<span class="token punctuation">)</span> <span class="token keyword">VALUES</span><span class="token punctuation">(</span><span class="token number">1</span><span class="token punctuation">,</span><span class="token number">1</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">,</span><span class="token number">4</span><span class="token punctuation">)</span><span class="token punctuation">,</span><span class="token punctuation">(</span><span class="token number">6</span><span class="token punctuation">,</span><span class="token number">8</span><span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Selecting from the table yields this result:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa69452357"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> <span class="token operator">*</span> <span class="token keyword">FROM</span> triangle<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> sidea <span class="token punctuation">|</span> sideb <span class="token punctuation">|</span> sidec              <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span>     1 <span class="token punctuation">|</span>     1 <span class="token punctuation">|</span> 1.4142135623730951 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>     3 <span class="token punctuation">|</span>     4 <span class="token punctuation">|</span>                  5 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>     6 <span class="token punctuation">|</span>     8 <span class="token punctuation">|</span>                 10 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   Any application that uses the
   <code class="literal">
    triangle
   </code>
   table
        has access to the hypotenuse values without having to specify
        the expression that calculates them.
  </p>
  <p>
   Generated column definitions have this syntax:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa75877956"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><em class="replaceable">col_name</em> <em class="replaceable">data_type</em> <span class="token punctuation">[</span><span class="token keyword">GENERATED</span> <span class="token keyword">ALWAYS</span><span class="token punctuation">]</span> <span class="token keyword">AS</span> <span class="token punctuation">(</span><em class="replaceable">expr</em><span class="token punctuation">)</span>
  <span class="token punctuation">[</span><span class="token keyword">VIRTUAL</span> <span class="token operator">|</span> <span class="token keyword">STORED</span><span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token operator">NOT</span> <span class="token boolean">NULL</span> <span class="token operator">|</span> <span class="token boolean">NULL</span><span class="token punctuation">]</span>
  <span class="token punctuation">[</span><span class="token keyword">UNIQUE</span> <span class="token punctuation">[</span><span class="token keyword">KEY</span><span class="token punctuation">]</span><span class="token punctuation">]</span> <span class="token punctuation">[</span><span class="token punctuation">[</span><span class="token keyword">PRIMARY</span><span class="token punctuation">]</span> <span class="token keyword">KEY</span><span class="token punctuation">]</span>
  <span class="token punctuation">[</span><span class="token keyword">COMMENT</span> <span class="token string">'<em class="replaceable">string</em>'</span><span class="token punctuation">]</span></code></pre>
  </div>
  <p>
   <code class="literal">
    AS (
    <em class="replaceable">
     <code>
      expr
     </code>
    </em>
    )
   </code>
   indicates that the column is generated and defines the
        expression used to compute column values.
   <code class="literal">
    AS
   </code>
   may be preceded by
   <code class="literal">
    GENERATED ALWAYS
   </code>
   to make
        the generated nature of the column more explicit. Constructs
        that are permitted or prohibited in the expression are discussed
        later.
  </p>
  <p>
   The
   <code class="literal">
    VIRTUAL
   </code>
   or
   <code class="literal">
    STORED
   </code>
   keyword indicates how column values are stored, which has
        implications for column use:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      <code class="literal">
       VIRTUAL
      </code>
      : Column values are not stored,
            but are evaluated when rows are read, immediately after any
      <code class="literal">
       BEFORE
      </code>
      triggers. A virtual column takes
            no storage.
     </p>
     <p>
      <code class="literal">
       InnoDB
      </code>
      supports secondary indexes on
            virtual columns. See
      <a class="xref" href="create-table-secondary-indexes.html" title="15.1.20.9 Secondary Indexes and Generated Columns">
       Section 15.1.20.9, “Secondary Indexes and Generated Columns”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      <code class="literal">
       STORED
      </code>
      : Column values are evaluated and
            stored when rows are inserted or updated. A stored column
            does require storage space and can be indexed.
     </p>
    </li>
   </ul>
  </div>
  <p>
   The default is
   <code class="literal">
    VIRTUAL
   </code>
   if neither keyword is
        specified.
  </p>
  <p>
   It is permitted to mix
   <code class="literal">
    VIRTUAL
   </code>
   and
   <code class="literal">
    STORED
   </code>
   columns within a table.
  </p>
  <p>
   Other attributes may be given to indicate whether the column is
        indexed or can be
   <code class="literal">
    NULL
   </code>
   , or provide a comment.
  </p>
  <p>
   Generated column expressions must adhere to the following rules.
        An error occurs if an expression contains disallowed constructs.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Literals, deterministic built-in functions, and operators
            are permitted. A function is deterministic if, given the
            same data in tables, multiple invocations produce the same
            result, independently of the connected user. Examples of
            functions that are nondeterministic and fail this
            definition:
      <a class="link" href="information-functions.html#function_connection-id">
       <code class="literal">
        CONNECTION_ID()
       </code>
      </a>
      ,
      <a class="link" href="information-functions.html#function_current-user">
       <code class="literal">
        CURRENT_USER()
       </code>
      </a>
      ,
      <a class="link" href="date-and-time-functions.html#function_now">
       <code class="literal">
        NOW()
       </code>
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored functions and loadable functions are not permitted.
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored procedure and function parameters are not permitted.
     </p>
    </li>
    <li class="listitem">
     <p>
      Variables (system variables, user-defined variables, and
            stored program local variables) are not permitted.
     </p>
    </li>
    <li class="listitem">
     <p>
      Subqueries are not permitted.
     </p>
    </li>
    <li class="listitem">
     <p>
      A generated column definition can refer to other generated
            columns, but only those occurring earlier in the table
            definition. A generated column definition can refer to any
            base (nongenerated) column in the table whether its
            definition occurs earlier or later.
     </p>
    </li>
    <li class="listitem">
     <p>
      The
      <code class="literal">
       AUTO_INCREMENT
      </code>
      attribute cannot be
            used in a generated column definition.
     </p>
    </li>
    <li class="listitem">
     <p>
      An
      <code class="literal">
       AUTO_INCREMENT
      </code>
      column cannot be used
            as a base column in a generated column definition.
     </p>
    </li>
    <li class="listitem">
     <p>
      If expression evaluation causes truncation or provides
            incorrect input to a function, the
      <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
       <code class="literal">
        CREATE TABLE
       </code>
      </a>
      statement
            terminates with an error and the DDL operation is rejected.
     </p>
    </li>
   </ul>
  </div>
  <p>
   If the expression evaluates to a data type that differs from the
        declared column type, implicit coercion to the declared type
        occurs according to the usual MySQL type-conversion rules. See
   <a class="xref" href="type-conversion.html" title="14.3 Type Conversion in Expression Evaluation">
    Section 14.3, “Type Conversion in Expression Evaluation”
   </a>
   .
  </p>
  <p>
   If a generated column uses the
   <a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
    <code class="literal">
     TIMESTAMP
    </code>
   </a>
   data type, the setting
        for
   <a class="link" href="server-system-variables.html#sysvar_explicit_defaults_for_timestamp">
    <code class="literal">
     explicit_defaults_for_timestamp
    </code>
   </a>
   is ignored. In such cases, if this variable is disabled then
   <code class="literal">
    NULL
   </code>
   is not converted to
   <a class="link" href="date-and-time-functions.html#function_current-timestamp">
    <code class="literal">
     CURRENT_TIMESTAMP
    </code>
   </a>
   . If the column
        is also declared as
   <code class="literal">
    NOT NULL
   </code>
   , attempting to
        insert
   <code class="literal">
    NULL
   </code>
   is explicitly rejected with
   <a class="ulink" href="/doc/mysql-errors/8.4/en/server-error-reference.html#error_er_bad_null_error" target="_top">
    <code class="literal">
     ER_BAD_NULL_ERROR
    </code>
   </a>
   .
  </p>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    Expression evaluation uses the SQL mode in effect at
          evaluation time. If any component of the expression depends on
          the SQL mode, different results may occur for different uses
          of the table unless the SQL mode is the same during all uses.
   </p>
  </div>
  <p>
   For
   <a class="link" href="create-table-like.html" title="15.1.20.3 CREATE TABLE ... LIKE Statement">
    <code class="literal">
     CREATE
        TABLE ... LIKE
    </code>
   </a>
   , the destination table preserves
        generated column information from the original table.
  </p>
  <p>
   For
   <a class="link" href="create-table-select.html" title="15.1.20.4 CREATE TABLE ... SELECT Statement">
    <code class="literal">
     CREATE
        TABLE ... SELECT
    </code>
   </a>
   , the destination table does not
        preserve information about whether columns in the selected-from
        table are generated columns. The
   <a class="link" href="select.html" title="15.2.13 SELECT Statement">
    <code class="literal">
     SELECT
    </code>
   </a>
   part of the statement
        cannot assign values to generated columns in the destination
        table.
  </p>
  <p>
   Partitioning by generated columns is permitted. See
   <a class="xref" href="create-table.html#create-table-partitioning" title="Table Partitioning">
    Table Partitioning
   </a>
   .
  </p>
  <p>
   A foreign key constraint on a stored generated column cannot use
   <code class="literal">
    CASCADE
   </code>
   ,
   <code class="literal">
    SET NULL
   </code>
   , or
   <code class="literal">
    SET DEFAULT
   </code>
   as
   <code class="literal">
    ON UPDATE
   </code>
   referential actions, nor can it use
   <code class="literal">
    SET NULL
   </code>
   or
   <code class="literal">
    SET DEFAULT
   </code>
   as
   <code class="literal">
    ON
        DELETE
   </code>
   referential actions.
  </p>
  <p>
   A foreign key constraint on the base column of a stored
        generated column cannot use
   <code class="literal">
    CASCADE
   </code>
   ,
   <code class="literal">
    SET NULL
   </code>
   , or
   <code class="literal">
    SET DEFAULT
   </code>
   as
   <code class="literal">
    ON UPDATE
   </code>
   or
   <code class="literal">
    ON DELETE
   </code>
   referential actions.
  </p>
  <p>
   A foreign key constraint cannot reference a virtual generated
        column.
  </p>
  <p>
   Triggers cannot use
   <code class="literal">
    NEW.
    <em class="replaceable">
     <code>
      col_name
     </code>
    </em>
   </code>
   or
        use
   <code class="literal">
    OLD.
    <em class="replaceable">
     <code>
      col_name
     </code>
    </em>
   </code>
   to refer to generated columns.
  </p>
  <p>
   For
   <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
    <code class="literal">
     INSERT
    </code>
   </a>
   ,
   <a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
    <code class="literal">
     REPLACE
    </code>
   </a>
   , and
   <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
    <code class="literal">
     UPDATE
    </code>
   </a>
   , if a generated column is
        inserted into, replaced, or updated explicitly, the only
        permitted value is
   <code class="literal">
    DEFAULT
   </code>
   .
  </p>
  <p>
   A generated column in a view is considered updatable because it
        is possible to assign to it. However, if such a column is
        updated explicitly, the only permitted value is
   <code class="literal">
    DEFAULT
   </code>
   .
  </p>
  <p>
   Generated columns have several use cases, such as these:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Virtual generated columns can be used as a way to simplify
            and unify queries. A complicated condition can be defined as
            a generated column and referred to from multiple queries on
            the table to ensure that all of them use exactly the same
            condition.
     </p>
    </li>
    <li class="listitem">
     <p>
      Stored generated columns can be used as a materialized cache
            for complicated conditions that are costly to calculate on
            the fly.
     </p>
    </li>
    <li class="listitem">
     <p>
      Generated columns can simulate functional indexes: Use a
            generated column to define a functional expression and index
            it. This can be useful for working with columns of types
            that cannot be indexed directly, such as
      <a class="link" href="json.html" title="13.5 The JSON Data Type">
       <code class="literal">
        JSON
       </code>
      </a>
      columns; see
      <a class="xref" href="create-table-secondary-indexes.html#json-column-indirect-index" title="Indexing a Generated Column to Provide a JSON Column Index">
       Indexing a Generated Column to Provide a JSON Column Index
      </a>
      , for a detailed
            example.
     </p>
     <p>
      For stored generated columns, the disadvantage of this
            approach is that values are stored twice; once as the value
            of the generated column and once in the index.
     </p>
    </li>
    <li class="listitem">
     <p>
      If a generated column is indexed, the optimizer recognizes
            query expressions that match the column definition and uses
            indexes from the column as appropriate during query
            execution, even if a query does not refer to the column
            directly by name. For details, see
      <a class="xref" href="generated-column-index-optimizations.html" title="10.3.11 Optimizer Use of Generated Column Indexes">
       Section 10.3.11, “Optimizer Use of Generated Column Indexes”
      </a>
      .
     </p>
    </li>
   </ul>
  </div>
  <p>
   Example:
  </p>
  <p>
   Suppose that a table
   <code class="literal">
    t1
   </code>
   contains
   <code class="literal">
    first_name
   </code>
   and
   <code class="literal">
    last_name
   </code>
   columns and that applications frequently construct the full name
        using an expression like this:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa74826322"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> <span class="token function">CONCAT</span><span class="token punctuation">(</span>first_name<span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">,</span>last_name<span class="token punctuation">)</span> <span class="token keyword">AS</span> full_name <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   One way to avoid writing out the expression is to create a view
   <code class="literal">
    v1
   </code>
   on
   <code class="literal">
    t1
   </code>
   , which simplifies
        applications by enabling them to select
   <code class="literal">
    full_name
   </code>
   directly without using an
        expression:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa11279815"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">VIEW</span> v1 <span class="token keyword">AS</span>
<span class="token keyword">SELECT</span> <span class="token operator">*</span><span class="token punctuation">,</span> <span class="token function">CONCAT</span><span class="token punctuation">(</span>first_name<span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">,</span>last_name<span class="token punctuation">)</span> <span class="token keyword">AS</span> full_name <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> full_name <span class="token keyword">FROM</span> v1<span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   A generated column also enables applications to select
   <code class="literal">
    full_name
   </code>
   directly without the need to define
        a view:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa89834980"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> t1 <span class="token punctuation">(</span>
  first_name <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  last_name <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
  full_name <span class="token datatype">VARCHAR</span><span class="token punctuation">(</span><span class="token number">255</span><span class="token punctuation">)</span> <span class="token keyword">AS</span> <span class="token punctuation">(</span><span class="token function">CONCAT</span><span class="token punctuation">(</span>first_name<span class="token punctuation">,</span><span class="token string">' '</span><span class="token punctuation">,</span>last_name<span class="token punctuation">)</span><span class="token punctuation">)</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>

<span class="token keyword">SELECT</span> full_name <span class="token keyword">FROM</span> t1<span class="token punctuation">;</span></code></pre>
  </div>
 </div>
 <br/>
</div>
