<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="extensions-to-ansi">
      </a>
      1.7.1 MySQL Extensions to Standard SQL
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045333531200">
  </a>
  <a class="indexterm" name="idm46045333529744">
  </a>
  <p>
   MySQL Server supports some extensions that you are not likely to
        find in other SQL DBMSs. Be warned that if you use them, your
        code is most likely not portable to other SQL servers. In some
        cases, you can write code that includes MySQL extensions, but is
        still portable, by using comments of the following form:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa56279089"><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 comment" spellcheck="true">/*! <em class="replaceable">MySQL-specific code</em> */</span></code></pre>
  </div>
  <p>
   In this case, MySQL Server parses and executes the code within
        the comment as it would any other SQL statement, but other SQL
        servers should ignore the extensions. For example, MySQL Server
        recognizes the
   <code class="literal">
    STRAIGHT_JOIN
   </code>
   keyword in the
        following statement, but other servers should not:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa60416901"><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 comment" spellcheck="true">/*! STRAIGHT_JOIN */</span> col1 <span class="token keyword">FROM</span> table1<span class="token punctuation">,</span>table2 <span class="token keyword">WHERE</span> <span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span></code></pre>
  </div>
  <p>
   If you add a version number after the
   <code class="literal">
    !
   </code>
   character, the syntax within the comment is executed only if the
        MySQL version is greater than or equal to the specified version
        number. The
   <code class="literal">
    KEY_BLOCK_SIZE
   </code>
   clause in the
        following comment is executed only by servers from MySQL 5.1.10
        or higher:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa89650678"><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>a <span class="token datatype">INT</span><span class="token punctuation">,</span> <span class="token keyword">KEY</span> <span class="token punctuation">(</span>a<span class="token punctuation">)</span><span class="token punctuation">)</span> <span class="token comment" spellcheck="true">/*!50110 KEY_BLOCK_SIZE=1024 */</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   The following descriptions list MySQL extensions, organized by
        category.
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      Organization of data on disk
     </p>
     <a class="indexterm" name="idm46045333519568">
     </a>
     <a class="indexterm" name="idm46045333518080">
     </a>
     <a class="indexterm" name="idm46045333516592">
     </a>
     <a class="indexterm" name="idm46045333515104">
     </a>
     <p>
      MySQL Server maps each database to a directory under the
            MySQL data directory, and maps tables within a database to
            file names in the database directory. Consequently, database
            and table names are case-sensitive in MySQL Server on
            operating systems that have case-sensitive file names (such
            as most Unix systems). See
      <a class="xref" href="identifier-case-sensitivity.html" title="11.2.3 Identifier Case Sensitivity">
       Section 11.2.3, “Identifier Case Sensitivity”
      </a>
      .
     </p>
    </li>
    <li class="listitem">
     <p>
      General language syntax
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         By default, strings can be enclosed by
         <code class="literal">
          "
         </code>
         as well as
         <code class="literal">
          '
         </code>
         . If
                the
         <a class="link" href="sql-mode.html#sqlmode_ansi_quotes">
          <code class="literal">
           ANSI_QUOTES
          </code>
         </a>
         SQL
                mode is enabled, strings can be enclosed only by
         <code class="literal">
          '
         </code>
         and the server interprets strings
                enclosed by
         <code class="literal">
          "
         </code>
         as identifiers.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          \
         </code>
         is the escape character in strings.
        </p>
       </li>
       <li class="listitem">
        <p>
         In SQL statements, you can access tables from different
                databases with the
         <em class="replaceable">
          <code>
           db_name.tbl_name
          </code>
         </em>
         syntax. Some
                SQL servers provide the same functionality but call this
         <code class="literal">
          User space
         </code>
         . MySQL Server doesn't
                support tablespaces such as used in statements like
                this:
         <code class="literal">
          CREATE TABLE ralph.my_table ... IN
                my_tablespace
         </code>
         .
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      SQL statement syntax
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         The
         <a class="link" href="analyze-table.html" title="15.7.3.1 ANALYZE TABLE Statement">
          <code class="literal">
           ANALYZE TABLE
          </code>
         </a>
         ,
         <a class="link" href="check-table.html" title="15.7.3.2 CHECK TABLE Statement">
          <code class="literal">
           CHECK TABLE
          </code>
         </a>
         ,
         <a class="link" href="optimize-table.html" title="15.7.3.4 OPTIMIZE TABLE Statement">
          <code class="literal">
           OPTIMIZE TABLE
          </code>
         </a>
         , and
         <a class="link" href="repair-table.html" title="15.7.3.5 REPAIR TABLE Statement">
          <code class="literal">
           REPAIR TABLE
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="create-database.html" title="15.1.12 CREATE DATABASE Statement">
          <code class="literal">
           CREATE DATABASE
          </code>
         </a>
         ,
         <a class="link" href="drop-database.html" title="15.1.24 DROP DATABASE Statement">
          <code class="literal">
           DROP DATABASE
          </code>
         </a>
         , and
         <a class="link" href="alter-database.html" title="15.1.2 ALTER DATABASE Statement">
          <code class="literal">
           ALTER DATABASE
          </code>
         </a>
         statements. See
         <a class="xref" href="create-database.html" title="15.1.12 CREATE DATABASE Statement">
          Section 15.1.12, “CREATE DATABASE Statement”
         </a>
         ,
         <a class="xref" href="drop-database.html" title="15.1.24 DROP DATABASE Statement">
          Section 15.1.24, “DROP DATABASE Statement”
         </a>
         , and
         <a class="xref" href="alter-database.html" title="15.1.2 ALTER DATABASE Statement">
          Section 15.1.2, “ALTER DATABASE Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="do.html" title="15.2.3 DO Statement">
          <code class="literal">
           DO
          </code>
         </a>
         statement.
        </p>
       </li>
       <li class="listitem">
        <p>
         <a class="link" href="explain.html" title="15.8.2 EXPLAIN Statement">
          <code class="literal">
           EXPLAIN
                SELECT
          </code>
         </a>
         to obtain a description of how tables
                are processed by the query optimizer.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="flush.html" title="15.7.8.3 FLUSH Statement">
          <code class="literal">
           FLUSH
          </code>
         </a>
         and
         <a class="link" href="reset.html" title="15.7.8.6 RESET Statement">
          <code class="literal">
           RESET
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
          <code class="literal">
           SET
          </code>
         </a>
         statement. See
         <a class="xref" href="set-variable.html" title="15.7.6.1 SET Syntax for Variable Assignment">
          Section 15.7.6.1, “SET Syntax for Variable Assignment”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="show.html" title="15.7.7 SHOW Statements">
          <code class="literal">
           SHOW
          </code>
         </a>
         statement. See
         <a class="xref" href="show.html" title="15.7.7 SHOW Statements">
          Section 15.7.7, “SHOW Statements”
         </a>
         . The information produced by many
                of the MySQL-specific
         <a class="link" href="show.html" title="15.7.7 SHOW Statements">
          <code class="literal">
           SHOW
          </code>
         </a>
         statements can be
                obtained in more standard fashion by using
         <a class="link" href="select.html" title="15.2.13 SELECT Statement">
          <code class="literal">
           SELECT
          </code>
         </a>
         to query
         <code class="literal">
          INFORMATION_SCHEMA
         </code>
         . See
         <a class="xref" href="information-schema.html" title="Chapter 28 INFORMATION_SCHEMA Tables">
          Chapter 28,
          <i>
           INFORMATION_SCHEMA Tables
          </i>
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         <a class="indexterm" name="idm46045333470464">
         </a>
         <a class="indexterm" name="idm46045333469392">
         </a>
         Use of
         <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
          <code class="literal">
           LOAD DATA
          </code>
         </a>
         . In many
                cases, this syntax is compatible with Oracle
         <a class="link" href="load-data.html" title="15.2.9 LOAD DATA Statement">
          <code class="literal">
           LOAD DATA
          </code>
         </a>
         . See
         <a class="xref" href="load-data.html" title="15.2.9 LOAD DATA Statement">
          Section 15.2.9, “LOAD DATA Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <a class="link" href="rename-table.html" title="15.1.36 RENAME TABLE Statement">
          <code class="literal">
           RENAME TABLE
          </code>
         </a>
         . See
         <a class="xref" href="rename-table.html" title="15.1.36 RENAME TABLE Statement">
          Section 15.1.36, “RENAME TABLE Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
          <code class="literal">
           REPLACE
          </code>
         </a>
         instead of
         <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
          <code class="literal">
           DELETE
          </code>
         </a>
         plus
         <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
          <code class="literal">
           INSERT
          </code>
         </a>
         . See
         <a class="xref" href="replace.html" title="15.2.12 REPLACE Statement">
          Section 15.2.12, “REPLACE Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <code class="literal">
          CHANGE
          <em class="replaceable">
           <code>
            col_name
           </code>
          </em>
         </code>
         ,
         <code class="literal">
          DROP
          <em class="replaceable">
           <code>
            col_name
           </code>
          </em>
         </code>
         , or
         <a class="link" href="drop-index.html" title="15.1.27 DROP INDEX Statement">
          <code class="literal">
           DROP INDEX
          </code>
         </a>
         ,
         <code class="literal">
          IGNORE
         </code>
         or
         <code class="literal">
          RENAME
         </code>
         in
         <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
          <code class="literal">
           ALTER TABLE
          </code>
         </a>
         statements. Use of multiple
         <code class="literal">
          ADD
         </code>
         ,
         <code class="literal">
          ALTER
         </code>
         ,
         <code class="literal">
          DROP
         </code>
         , or
         <code class="literal">
          CHANGE
         </code>
         clauses in an
         <a class="link" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
          <code class="literal">
           ALTER TABLE
          </code>
         </a>
         statement.
                See
         <a class="xref" href="alter-table.html" title="15.1.9 ALTER TABLE Statement">
          Section 15.1.9, “ALTER TABLE Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of index names, indexes on a prefix of a column, and
                use of
         <code class="literal">
          INDEX
         </code>
         or
         <code class="literal">
          KEY
         </code>
         in
         <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
          <code class="literal">
           CREATE
                TABLE
          </code>
         </a>
         statements. See
         <a class="xref" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
          Section 15.1.20, “CREATE TABLE Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <code class="literal">
          TEMPORARY
         </code>
         or
         <code class="literal">
          IF NOT
                EXISTS
         </code>
         with
         <a class="link" href="create-table.html" title="15.1.20 CREATE TABLE Statement">
          <code class="literal">
           CREATE
                TABLE
          </code>
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <code class="literal">
          IF EXISTS
         </code>
         with
         <a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
          <code class="literal">
           DROP TABLE
          </code>
         </a>
         and
         <a class="link" href="drop-database.html" title="15.1.24 DROP DATABASE Statement">
          <code class="literal">
           DROP DATABASE
          </code>
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         The capability of dropping multiple tables with a single
         <a class="link" href="drop-table.html" title="15.1.32 DROP TABLE Statement">
          <code class="literal">
           DROP TABLE
          </code>
         </a>
         statement.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <code class="literal">
          ORDER BY
         </code>
         and
         <code class="literal">
          LIMIT
         </code>
         clauses of the
         <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
          <code class="literal">
           UPDATE
          </code>
         </a>
         and
         <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
          <code class="literal">
           DELETE
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         <code class="literal">
          INSERT INTO
          <em class="replaceable">
           <code>
            tbl_name
           </code>
          </em>
          SET
          <em class="replaceable">
           <code>
            col_name
           </code>
          </em>
          = ...
         </code>
         syntax.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <code class="literal">
          DELAYED
         </code>
         clause of the
         <a class="link" href="insert.html" title="15.2.7 INSERT Statement">
          <code class="literal">
           INSERT
          </code>
         </a>
         and
         <a class="link" href="replace.html" title="15.2.12 REPLACE Statement">
          <code class="literal">
           REPLACE
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <code class="literal">
          LOW_PRIORITY
         </code>
         clause of the
         <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>
         ,
         <a class="link" href="delete.html" title="15.2.2 DELETE Statement">
          <code class="literal">
           DELETE
          </code>
         </a>
         , and
         <a class="link" href="update.html" title="15.2.17 UPDATE Statement">
          <code class="literal">
           UPDATE
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <code class="literal">
          INTO OUTFILE
         </code>
         or
         <code class="literal">
          INTO
                DUMPFILE
         </code>
         in
         <a class="link" href="select.html" title="15.2.13 SELECT Statement">
          <code class="literal">
           SELECT
          </code>
         </a>
         statements. See
         <a class="xref" href="select.html" title="15.2.13 SELECT Statement">
          Section 15.2.13, “SELECT Statement”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         Options such as
         <code class="literal">
          STRAIGHT_JOIN
         </code>
         or
         <code class="literal">
          SQL_SMALL_RESULT
         </code>
         in
         <a class="link" href="select.html" title="15.2.13 SELECT Statement">
          <code class="literal">
           SELECT
          </code>
         </a>
         statements.
        </p>
       </li>
       <li class="listitem">
        <p>
         You don't need to name all selected columns in the
         <code class="literal">
          GROUP BY
         </code>
         clause. This gives better
                performance for some very specific, but quite normal
                queries. See
         <a class="xref" href="aggregate-functions-and-modifiers.html" title="14.19 Aggregate Functions">
          Section 14.19, “Aggregate Functions”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         You can specify
         <code class="literal">
          ASC
         </code>
         and
         <code class="literal">
          DESC
         </code>
         with
         <code class="literal">
          GROUP
                BY
         </code>
         , not just with
         <code class="literal">
          ORDER BY
         </code>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         The ability to set variables in a statement with the
         <code class="literal">
          :=
         </code>
         assignment operator. See
         <a class="xref" href="user-variables.html" title="11.4 User-Defined Variables">
          Section 11.4, “User-Defined Variables”
         </a>
         .
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      Data types
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         The
         <a class="link" href="integer-types.html" title="13.1.2 Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT">
          <code class="literal">
           MEDIUMINT
          </code>
         </a>
         ,
         <a class="link" href="set.html" title="13.3.6 The SET Type">
          <code class="literal">
           SET
          </code>
         </a>
         , and
         <a class="link" href="enum.html" title="13.3.5 The ENUM Type">
          <code class="literal">
           ENUM
          </code>
         </a>
         data types, and the
                various
         <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
          <code class="literal">
           BLOB
          </code>
         </a>
         and
         <a class="link" href="blob.html" title="13.3.4 The BLOB and TEXT Types">
          <code class="literal">
           TEXT
          </code>
         </a>
         data types.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <code class="literal">
          AUTO_INCREMENT
         </code>
         ,
         <code class="literal">
          BINARY
         </code>
         ,
         <code class="literal">
          NULL
         </code>
         ,
         <code class="literal">
          UNSIGNED
         </code>
         , and
         <code class="literal">
          ZEROFILL
         </code>
         data type attributes.
        </p>
       </li>
      </ul>
     </div>
    </li>
    <li class="listitem">
     <p>
      Functions and operators
     </p>
     <div class="itemizedlist">
      <ul class="itemizedlist" style="list-style-type: circle; ">
       <li class="listitem">
        <p>
         To make it easier for users who migrate from other SQL
                environments, MySQL Server supports aliases for many
                functions. For example, all string functions support
                both standard SQL syntax and ODBC syntax.
        </p>
       </li>
       <li class="listitem">
        <p>
         MySQL Server understands the
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           ||
          </code>
         </a>
         and
         <a class="link" href="logical-operators.html#operator_and">
          <code class="literal">
           &amp;&amp;
          </code>
         </a>
         operators to mean logical OR and AND, as in the C
                programming language. In MySQL Server,
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           ||
          </code>
         </a>
         and
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           OR
          </code>
         </a>
         are
                synonyms, as are
         <a class="link" href="logical-operators.html#operator_and">
          <code class="literal">
           &amp;&amp;
          </code>
         </a>
         and
         <a class="link" href="logical-operators.html#operator_and">
          <code class="literal">
           AND
          </code>
         </a>
         .
                Because of this nice syntax, MySQL Server doesn't
                support the standard SQL
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           ||
          </code>
         </a>
         operator
                for string concatenation; use
         <a class="link" href="string-functions.html#function_concat">
          <code class="literal">
           CONCAT()
          </code>
         </a>
         instead. Because
         <a class="link" href="string-functions.html#function_concat">
          <code class="literal">
           CONCAT()
          </code>
         </a>
         takes any number
                of arguments, it is easy to convert use of the
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           ||
          </code>
         </a>
         operator
                to MySQL Server.
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <a class="link" href="aggregate-functions.html#function_count">
          <code class="literal">
           COUNT(DISTINCT
           <em class="replaceable">
            <code>
             value_list
            </code>
           </em>
           )
          </code>
         </a>
         where
         <em class="replaceable">
          <code>
           value_list
          </code>
         </em>
         has more than one
                element.
        </p>
       </li>
       <li class="listitem">
        <p>
         String comparisons are case-insensitive by default, with
                sort ordering determined by the collation of the current
                character set, which is
         <code class="literal">
          utf8mb4
         </code>
         by
                default. To perform case-sensitive comparisons instead,
                you should declare your columns with the
         <code class="literal">
          BINARY
         </code>
         attribute or use the
         <code class="literal">
          BINARY
         </code>
         cast, which causes comparisons
                to be done using the underlying character code values
                rather than a lexical ordering.
        </p>
       </li>
       <li class="listitem">
        <p>
         <a class="indexterm" name="idm46045333360672">
         </a>
         <a class="indexterm" name="idm46045333359584">
         </a>
         The
         <a class="link" href="mathematical-functions.html#function_mod">
          <code class="literal">
           %
          </code>
         </a>
         operator is a synonym for
         <a class="link" href="mathematical-functions.html#function_mod">
          <code class="literal">
           MOD()
          </code>
         </a>
         . That is,
         <code class="literal">
          <em class="replaceable">
           <code>
            N
           </code>
          </em>
          %
          <em class="replaceable">
           <code>
            M
           </code>
          </em>
         </code>
         is equivalent to
         <a class="link" href="mathematical-functions.html#function_mod">
          <code class="literal">
           MOD(
           <em class="replaceable">
            <code>
             N
            </code>
           </em>
           ,
           <em class="replaceable">
            <code>
             M
            </code>
           </em>
           )
          </code>
         </a>
         .
         <a class="link" href="mathematical-functions.html#function_mod">
          <code class="literal">
           %
          </code>
         </a>
         is
                supported for C programmers and for compatibility with
                PostgreSQL.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="comparison-operators.html#operator_equal">
          <code class="literal">
           =
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_not-equal">
          <code class="literal">
           &lt;&gt;
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_less-than-or-equal">
          <code class="literal">
           &lt;=
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_less-than">
          <code class="literal">
           &lt;
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_greater-than-or-equal">
          <code class="literal">
           &gt;=
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_greater-than">
          <code class="literal">
           &gt;
          </code>
         </a>
         ,
         <a class="link" href="bit-functions.html#operator_left-shift">
          <code class="literal">
           &lt;&lt;
          </code>
         </a>
         ,
         <a class="link" href="bit-functions.html#operator_right-shift">
          <code class="literal">
           &gt;&gt;
          </code>
         </a>
         ,
         <a class="link" href="comparison-operators.html#operator_equal-to">
          <code class="literal">
           &lt;=&gt;
          </code>
         </a>
         ,
         <a class="link" href="logical-operators.html#operator_and">
          <code class="literal">
           AND
          </code>
         </a>
         ,
         <a class="link" href="logical-operators.html#operator_or">
          <code class="literal">
           OR
          </code>
         </a>
         , or
         <a class="link" href="string-comparison-functions.html#operator_like">
          <code class="literal">
           LIKE
          </code>
         </a>
         operators may be used in expressions in the output
                column list (to the left of the
         <code class="literal">
          FROM
         </code>
         )
                in
         <a class="link" href="select.html" title="15.2.13 SELECT Statement">
          <code class="literal">
           SELECT
          </code>
         </a>
         statements. For
                example:
        </p>
        <div class="copytoclipboard-wrapper">
         <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa28409603"><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> col1<span class="token operator">=</span><span class="token number">1</span> <span class="token operator">AND</span> col2<span class="token operator">=</span><span class="token number">2</span> <span class="token keyword">FROM</span> my_table<span class="token punctuation">;</span></code></pre>
        </div>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="information-functions.html#function_last-insert-id">
          <code class="literal">
           LAST_INSERT_ID()
          </code>
         </a>
         function returns the most recent
         <code class="literal">
          AUTO_INCREMENT
         </code>
         value. See
         <a class="xref" href="information-functions.html" title="14.15 Information Functions">
          Section 14.15, “Information Functions”
         </a>
         .
        </p>
       </li>
       <li class="listitem">
        <p>
         <a class="link" href="string-comparison-functions.html#operator_like">
          <code class="literal">
           LIKE
          </code>
         </a>
         is permitted on
                numeric values.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="regexp.html#operator_regexp">
          <code class="literal">
           REGEXP
          </code>
         </a>
         and
         <a class="link" href="regexp.html#operator_not-regexp">
          <code class="literal">
           NOT REGEXP
          </code>
         </a>
         extended regular
                expression operators.
        </p>
       </li>
       <li class="listitem">
        <p>
         <a class="link" href="string-functions.html#function_concat">
          <code class="literal">
           CONCAT()
          </code>
         </a>
         or
         <a class="link" href="string-functions.html#function_char">
          <code class="literal">
           CHAR()
          </code>
         </a>
         with one argument
                or more than two arguments. (In MySQL Server, these
                functions can take a variable number of arguments.)
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <a class="link" href="bit-functions.html#function_bit-count">
          <code class="literal">
           BIT_COUNT()
          </code>
         </a>
         ,
         <a class="link" href="flow-control-functions.html#operator_case">
          <code class="literal">
           CASE
          </code>
         </a>
         ,
         <a class="link" href="string-functions.html#function_elt">
          <code class="literal">
           ELT()
          </code>
         </a>
         ,
         <a class="link" href="date-and-time-functions.html#function_from-days">
          <code class="literal">
           FROM_DAYS()
          </code>
         </a>
         ,
         <a class="link" href="string-functions.html#function_format">
          <code class="literal">
           FORMAT()
          </code>
         </a>
         ,
         <a class="link" href="flow-control-functions.html#function_if">
          <code class="literal">
           IF()
          </code>
         </a>
         ,
         <a class="link" href="encryption-functions.html#function_md5">
          <code class="literal">
           MD5()
          </code>
         </a>
         ,
         <a class="link" href="date-and-time-functions.html#function_period-add">
          <code class="literal">
           PERIOD_ADD()
          </code>
         </a>
         ,
         <a class="link" href="date-and-time-functions.html#function_period-diff">
          <code class="literal">
           PERIOD_DIFF()
          </code>
         </a>
         ,
         <a class="link" href="date-and-time-functions.html#function_to-days">
          <code class="literal">
           TO_DAYS()
          </code>
         </a>
         , and
         <a class="link" href="date-and-time-functions.html#function_weekday">
          <code class="literal">
           WEEKDAY()
          </code>
         </a>
         functions.
        </p>
       </li>
       <li class="listitem">
        <p>
         Use of
         <a class="link" href="string-functions.html#function_trim">
          <code class="literal">
           TRIM()
          </code>
         </a>
         to trim
                substrings. Standard SQL supports removal of single
                characters only.
        </p>
       </li>
       <li class="listitem">
        <p>
         The
         <code class="literal">
          GROUP BY
         </code>
         functions
         <a class="link" href="aggregate-functions.html#function_std">
          <code class="literal">
           STD()
          </code>
         </a>
         ,
         <a class="link" href="aggregate-functions.html#function_bit-or">
          <code class="literal">
           BIT_OR()
          </code>
         </a>
         ,
         <a class="link" href="aggregate-functions.html#function_bit-and">
          <code class="literal">
           BIT_AND()
          </code>
         </a>
         ,
         <a class="link" href="aggregate-functions.html#function_bit-xor">
          <code class="literal">
           BIT_XOR()
          </code>
         </a>
         , and
         <a class="link" href="aggregate-functions.html#function_group-concat">
          <code class="literal">
           GROUP_CONCAT()
          </code>
         </a>
         . See
         <a class="xref" href="aggregate-functions-and-modifiers.html" title="14.19 Aggregate Functions">
          Section 14.19, “Aggregate Functions”
         </a>
         .
        </p>
       </li>
      </ul>
     </div>
    </li>
   </ul>
  </div>
 </div>
 <br/>
</div>
