<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="mysql-shell-tutorial-javascript-table-select">
      </a>
      22.3.4.2 Select Tables
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045127582048">
  </a>
  <p>
   You can use the
   <code class="literal">
    select()
   </code>
   method to query for
        and return records from a table in a database. The X DevAPI
        provides additional methods to use with the
   <code class="literal">
    select()
   </code>
   method to filter and sort the
        returned records.
  </p>
  <p>
   MySQL provides the following operators to specify search
        conditions:
   <code class="literal">
    OR
   </code>
   (
   <code class="literal">
    ||
   </code>
   ),
   <code class="literal">
    AND
   </code>
   (
   <code class="literal">
    &amp;&amp;
   </code>
   ),
   <code class="literal">
    XOR
   </code>
   ,
   <code class="literal">
    IS
   </code>
   ,
   <code class="literal">
    NOT
   </code>
   ,
   <code class="literal">
    BETWEEN
   </code>
   ,
   <code class="literal">
    IN
   </code>
   ,
   <code class="literal">
    LIKE
   </code>
   ,
   <code class="literal">
    !=
   </code>
   ,
   <code class="literal">
    &lt;&gt;
   </code>
   ,
   <code class="literal">
    &gt;
   </code>
   ,
   <code class="literal">
    &gt;=
   </code>
   ,
   <code class="literal">
    &lt;
   </code>
   ,
   <code class="literal">
    &lt;=
   </code>
   ,
   <code class="literal">
    &amp;
   </code>
   ,
   <code class="literal">
    |
   </code>
   ,
   <code class="literal">
    &lt;&lt;
   </code>
   ,
   <code class="literal">
    &gt;&gt;
   </code>
   ,
   <code class="literal">
    +
   </code>
   ,
   <code class="literal">
    -
   </code>
   ,
   <code class="literal">
    *
   </code>
   ,
   <code class="literal">
    /
   </code>
   ,
   <code class="literal">
    ~
   </code>
   , and
   <code class="literal">
    %
   </code>
   .
  </p>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-shell-tutorial-javascript-select-all-records">
       </a>
       Select All Records
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045127558944">
   </a>
   <p>
    To issue a query that returns all records from an existing
          table, use the
    <code class="literal">
     select()
    </code>
    method without
          specifying search conditions. The following example selects
          all records from the city table in the
    <code class="literal">
     world_x
    </code>
    database.
   </p>
   <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Note
    </div>
    <p>
     Limit the use of the empty
     <code class="literal">
      select()
     </code>
     method to interactive statements. Always use explicit
            column-name selections in your application code.
    </p>
   </div>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa29425894"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><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 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> ID   <span class="token punctuation">|</span> Name       <span class="token punctuation">|</span> CountryCode <span class="token punctuation">|</span> District   <span class="token punctuation">|</span> Info                    <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 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> Kabul      <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span> Kabol      <span class="token punctuation">|</span>{"Population": 1780000}  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    2 <span class="token punctuation">|</span> Qandahar   <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span> Qandahar   <span class="token punctuation">|</span>{"Population": 237500}   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span>    3 <span class="token punctuation">|</span> Herat      <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span> Herat      <span class="token punctuation">|</span>{"Population": 186800}   <span class="token punctuation">|</span></span>
<span class="token operator">...</span>    <span class="token operator">...</span>          <span class="token operator">...</span>           <span class="token operator">...</span>          <span class="token operator">...</span>
<span class="token output"><span class="token punctuation">|</span> 4079 <span class="token punctuation">|</span> Rafah      <span class="token punctuation">|</span> PSE         <span class="token punctuation">|</span> Rafah      <span class="token punctuation">|</span>{"Population": 92020}    <span class="token punctuation">|</span></span>
<span class="token operator">+</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">+</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">-</span> <span class="token operator">--</span><span class="token operator">--</span><span class="token operator">+</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">-</span><span class="token operator">+</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">+</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">--</span><span class="token operator">-</span><span class="token operator">+</span>
<span class="token output">4082 rows in set (0.01 sec)</span></code></pre>
   </div>
   <p>
    An empty set (no matching records) returns the following
          information:
   </p>
   <pre class="screen">Empty set (0.00 sec)
</pre>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-shell-tutorial-javascript-filter-searches">
       </a>
       Filter Searches
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045127548928">
   </a>
   <p>
    To issue a query that returns a set of table columns, use the
    <code class="literal">
     select()
    </code>
    method and specify the columns to
          return between square brackets. This query returns the Name
          and CountryCode columns from the city table.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa55843529"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"CountryCode"</span><span class="token punctuation">]</span><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>
<span class="token output"><span class="token punctuation">|</span> Name              <span class="token punctuation">|</span> CountryCode <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>
<span class="token output"><span class="token punctuation">|</span> Kabul             <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Qandahar          <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Herat             <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Mazar<span class="token punctuation">-</span>e<span class="token punctuation">-</span>Sharif    <span class="token punctuation">|</span> AFG         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Amsterdam         <span class="token punctuation">|</span> NLD         <span class="token punctuation">|</span></span>
<span class="token operator">...</span>                 <span class="token operator">...</span>
<span class="token output"><span class="token punctuation">|</span> Rafah             <span class="token punctuation">|</span> PSE         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Olympia           <span class="token punctuation">|</span> USA         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Little Falls      <span class="token punctuation">|</span> USA         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Happy Valley      <span class="token punctuation">|</span> USA         <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>
<span class="token output">4082 rows in set (0.00 sec)</span></code></pre>
   </div>
   <p>
    To issue a query that returns rows matching specific search
          conditions, use the
    <code class="literal">
     where()
    </code>
    method to
          include those conditions. For example, the following example
          returns the names and country codes of the cities that start
          with the letter Z.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa27310473"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"CountryCode"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">where</span><span class="token punctuation">(</span><span class="token string">"Name like 'Z%'"</span><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>
<span class="token output"><span class="token punctuation">|</span> Name              <span class="token punctuation">|</span> CountryCode <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>
<span class="token output"><span class="token punctuation">|</span> Zaanstad          <span class="token punctuation">|</span> NLD         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zoetermeer        <span class="token punctuation">|</span> NLD         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zwolle            <span class="token punctuation">|</span> NLD         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zenica            <span class="token punctuation">|</span> BIH         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zagazig           <span class="token punctuation">|</span> EGY         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zaragoza          <span class="token punctuation">|</span> ESP         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zamboanga         <span class="token punctuation">|</span> PHL         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zahedan           <span class="token punctuation">|</span> IRN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zanjan            <span class="token punctuation">|</span> IRN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zabol             <span class="token punctuation">|</span> IRN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zama              <span class="token punctuation">|</span> JPN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhezqazghan       <span class="token punctuation">|</span> KAZ         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhengzhou         <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token operator">...</span>                 <span class="token operator">...</span>
<span class="token output"><span class="token punctuation">|</span> Zeleznogorsk      <span class="token punctuation">|</span> RUS         <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>
<span class="token output">59 rows in set (0.00 sec)</span></code></pre>
   </div>
   <p>
    You can separate a value from the search condition by using
          the
    <code class="literal">
     bind()
    </code>
    method. For example, instead of
          using "Name = 'Z%' " as the condition, substitute a named
          placeholder consisting of a colon followed by a name that
          begins with a letter, such as
    <span class="emphasis">
     <em>
      name
     </em>
    </span>
    . Then
          include the placeholder and value in the
    <code class="literal">
     bind()
    </code>
    method as follows:
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa26890190"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"CountryCode"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span>
              <span class="token function">where</span><span class="token punctuation">(</span><span class="token string">"Name like :name"</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span><span class="token string">"name"</span><span class="token punctuation">,</span> <span class="token string">"Z%"</span><span class="token punctuation">)</span></code></pre>
   </div>
   <div class="tip" style="margin-left: 0.5in; margin-right: 0.5in;">
    <div class="admon-title">
     Tip
    </div>
    <p>
     Within a program, binding enables you to specify
            placeholders in your expressions, which are filled in with
            values before execution and can benefit from automatic
            escaping, as appropriate.
    </p>
    <p>
     Always use binding to sanitize input. Avoid introducing
            values in queries using string concatenation, which can
            produce invalid input and, in some cases, can cause security
            issues.
    </p>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-shell-tutorial-javascript-project-results">
       </a>
       Project Results
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045127532784">
   </a>
   <p>
    To issue a query using the
    <a class="link" href="logical-operators.html#operator_and">
     <code class="literal">
      AND
     </code>
    </a>
    operator, add the operator between search conditions in the
    <code class="literal">
     where()
    </code>
    method.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa73317001"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"CountryCode"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">where</span><span class="token punctuation">(</span>
<span class="token string">"Name like 'Z%' and CountryCode = 'CHN'"</span><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>
<span class="token output"><span class="token punctuation">|</span> Name           <span class="token punctuation">|</span> CountryCode <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>
<span class="token output"><span class="token punctuation">|</span> Zhengzhou      <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zibo           <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhangjiakou    <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhuzhou        <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhangjiang     <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zigong         <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zaozhuang      <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token operator">...</span>              <span class="token operator">...</span>
<span class="token output"><span class="token punctuation">|</span> Zhangjiagang   <span class="token punctuation">|</span> CHN         <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>
<span class="token output">22 rows in set (0.01 sec)</span></code></pre>
   </div>
   <p>
    To specify multiple conditional operators, you can enclose the
          search conditions in parenthesis to change the operator
          precedence. The following example demonstrates the placement
          of
    <a class="link" href="logical-operators.html#operator_and">
     <code class="literal">
      AND
     </code>
    </a>
    and
    <a class="link" href="logical-operators.html#operator_or">
     <code class="literal">
      OR
     </code>
    </a>
    operators.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa4644561"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>city<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name"</span><span class="token punctuation">,</span> <span class="token string">"CountryCode"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span>
<span class="token function">where</span><span class="token punctuation">(</span><span class="token string">"Name like 'Z%' and (CountryCode = 'CHN' or CountryCode = 'RUS')"</span><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>
<span class="token output"><span class="token punctuation">|</span> Name              <span class="token punctuation">|</span> CountryCode <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>
<span class="token output"><span class="token punctuation">|</span> Zhengzhou         <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zibo              <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhangjiakou       <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> Zhuzhou           <span class="token punctuation">|</span> CHN         <span class="token punctuation">|</span></span>
<span class="token operator">...</span>                 <span class="token operator">...</span>
<span class="token output"><span class="token punctuation">|</span> Zeleznogorsk      <span class="token punctuation">|</span> RUS         <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>
<span class="token output">29 rows in set (0.01 sec)</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="mysql-shell-tutorial-javascript-limit-order-offset-results">
       </a>
       Limit, Order, and Offset Results
      </h5>
     </div>
    </div>
   </div>
   <a class="indexterm" name="idm46045127520176">
   </a>
   <p>
    You can apply the
    <code class="literal">
     limit()
    </code>
    ,
    <code class="literal">
     orderBy()
    </code>
    , and
    <code class="literal">
     offSet()
    </code>
    methods to manage the number and order of records returned by
          the
    <code class="literal">
     select()
    </code>
    method.
   </p>
   <p>
    To specify the number of records included in a result set,
          append the
    <code class="literal">
     limit()
    </code>
    method with a value to
          the
    <code class="literal">
     select()
    </code>
    method. For example, the
          following query returns the first five records in the country
          table.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa36656999"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>country<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Code"</span><span class="token punctuation">,</span> <span class="token string">"Name"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">limit</span><span class="token punctuation">(</span><span class="token number">5</span><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>
<span class="token output"><span class="token punctuation">|</span> Code <span class="token punctuation">|</span> Name        <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>
<span class="token output"><span class="token punctuation">|</span> ABW  <span class="token punctuation">|</span> Aruba       <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> AFG  <span class="token punctuation">|</span> Afghanistan <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> AGO  <span class="token punctuation">|</span> Angola      <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> AIA  <span class="token punctuation">|</span> Anguilla    <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> ALB  <span class="token punctuation">|</span> Albania     <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>
<span class="token output">5 rows in set (0.00 sec)</span></code></pre>
   </div>
   <p>
    To specify an order for the results, append the
    <code class="literal">
     orderBy()
    </code>
    method to the
    <code class="literal">
     select()
    </code>
    method. Pass to the
    <code class="literal">
     orderBy()
    </code>
    method a list of one or more
          columns to sort by and, optionally, the descending
          (
    <code class="literal">
     desc
    </code>
    ) or ascending
          (
    <code class="literal">
     asc
    </code>
    ) attribute as appropriate. Ascending
          order is the default order type.
   </p>
   <p>
    For example, the following query sorts all records by the Name
          column and then returns the first three records in descending
          order .
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa89349612"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>country<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Code"</span><span class="token punctuation">,</span> <span class="token string">"Name"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">orderBy</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name desc"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">limit</span><span class="token punctuation">(</span><span class="token number">3</span><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>
<span class="token output"><span class="token punctuation">|</span> Code <span class="token punctuation">|</span> Name       <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>
<span class="token output"><span class="token punctuation">|</span> ZWE  <span class="token punctuation">|</span> Zimbabwe   <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> ZMB  <span class="token punctuation">|</span> Zambia     <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> YUG  <span class="token punctuation">|</span> Yugoslavia <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>
<span class="token output">3 rows in set (0.00 sec)</span></code></pre>
   </div>
   <p>
    By default, the
    <code class="literal">
     limit()
    </code>
    method starts from
          the first record in the table. You can use the
    <code class="literal">
     offset()
    </code>
    method to change the starting
          record. For example, to ignore the first record and return the
          next three records matching the condition, pass to the
    <code class="literal">
     offset()
    </code>
    method a value of 1.
   </p>
   <div class="copytoclipboard-wrapper">
    <pre class="programlisting language-mysqlsh"><div class="docs-select-all right" id="sa95590822"><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-mysqlsh"><span class="token prompt">mysql-js&gt;</span> db<span class="token punctuation">.</span>country<span class="token punctuation">.</span><span class="token function">select</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Code"</span><span class="token punctuation">,</span> <span class="token string">"Name"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">orderBy</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token string">"Name desc"</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">limit</span><span class="token punctuation">(</span><span class="token number">3</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token function">offset</span><span class="token punctuation">(</span><span class="token number">1</span><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>
<span class="token output"><span class="token punctuation">|</span> Code <span class="token punctuation">|</span> Name       <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>
<span class="token output"><span class="token punctuation">|</span> ZMB  <span class="token punctuation">|</span> Zambia     <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> YUG  <span class="token punctuation">|</span> Yugoslavia <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> YEM  <span class="token punctuation">|</span> Yemen      <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>
<span class="token output">3 rows in set (0.00 sec)</span></code></pre>
   </div>
  </div>
  <div class="simplesect">
   <div class="titlepage">
    <div>
     <div class="simple">
      <h5 class="title">
       <a name="idm46045127499792">
       </a>
       Related Information
      </h5>
     </div>
    </div>
   </div>
   <div class="itemizedlist">
    <ul class="itemizedlist" style="list-style-type: disc; ">
     <li class="listitem">
      <p>
       The
       <a class="link" href="functions.html" title="Chapter 14 Functions and Operators">
        MySQL Reference
              Manual
       </a>
       provides detailed documentation on functions
              and operators.
      </p>
     </li>
     <li class="listitem">
      <p>
       See
       <a class="ulink" href="/doc/x-devapi-userguide/en/crud-ebnf-table-crud-functions.html#crud-ebnf-tableselectfunction" target="_top">
        TableSelectFunction
       </a>
       for
              the full syntax definition.
      </p>
     </li>
    </ul>
   </div>
  </div>
 </div>
 <br/>
</div>
