sql语法高亮

This commit is contained in:
fofolee
2019-05-07 10:15:08 +08:00
parent 6cf279e189
commit 2bf87e1e25
67 changed files with 128 additions and 128 deletions

View File

@@ -1,6 +1,6 @@
<div class="m-bg">
<h1>SQL SELECT TOP 子句</h1>
<h2>SQL SELECT TOP 子句</h2> <p>SELECT TOP 子句用于规定要返回的记录的数目。</p> <p>SELECT TOP 子句对于拥有数千条记录的大型表来说,是非常有用的。</p> <p><b>注释:</b>并非所有的数据库系统都支持 SELECT TOP 子句。</p> <h3>SQL Server / MS Access 语法</h3> <div class="code notranslate"><pre><div> SELECT TOP <em>number</em>|<em>percent</em> <em>column_name(s)</em><br/> FROM <em>table_name</em>;</div></pre></div> <h2>MySQL 和 Oracle 中的 SQL SELECT TOP 是等价的</h2> <h3>MySQL 语法</h3> <div class="code notranslate"><pre><div> SELECT <em>column_name(s)</em><br/> FROM <em>table_name</em><br/> LIMIT <em>number</em>;</div></pre></div> <h3>实例</h3> <div class="code notranslate"><pre><div> SELECT *<br/> FROM Persons<br/> LIMIT 5;</div></pre></div> <h3>Oracle 语法</h3> <div class="code notranslate"><pre><div> SELECT <em>column_name(s)</em><br/> FROM <em>table_name</em><br/> WHERE ROWNUM &lt;= <em>number</em>;</div></pre></div> <h3>实例</h3> <div class="code notranslate"><pre><div> SELECT *<br/> FROM Persons<br/> WHERE ROWNUM &lt;=5;</div></pre></div> <h2>演示数据库</h2> <p>在本教程中,我们将使用众所周知的 Northwind 样本数据库。</p> <p>下面是选自 "Customers" 表的数据:</p> <table class="reference notranslate">
<h2>SQL SELECT TOP 子句</h2> <p>SELECT TOP 子句用于规定要返回的记录的数目。</p> <p>SELECT TOP 子句对于拥有数千条记录的大型表来说,是非常有用的。</p> <p><b>注释:</b>并非所有的数据库系统都支持 SELECT TOP 子句。</p> <h3>SQL Server / MS Access 语法</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT TOP <em>number</em>|<em>percent</em> <em>column_name(s)</em><br/> FROM <em>table_name</em>;</div></code></pre></div> <h2>MySQL 和 Oracle 中的 SQL SELECT TOP 是等价的</h2> <h3>MySQL 语法</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT <em>column_name(s)</em><br/> FROM <em>table_name</em><br/> LIMIT <em>number</em>;</div></code></pre></div> <h3>实例</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT *<br/> FROM Persons<br/> LIMIT 5;</div></code></pre></div> <h3>Oracle 语法</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT <em>column_name(s)</em><br/> FROM <em>table_name</em><br/> WHERE ROWNUM &lt;= <em>number</em>;</div></code></pre></div> <h3>实例</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT *<br/> FROM Persons<br/> WHERE ROWNUM &lt;=5;</div></code></pre></div> <h2>演示数据库</h2> <p>在本教程中,我们将使用众所周知的 Northwind 样本数据库。</p> <p>下面是选自 "Customers" 表的数据:</p> <table class="reference notranslate">
<tr>
<th>CustomerID</th> <th>CustomerName</th> <th>ContactName</th> <th>Address</th> <th>City</th> <th>PostalCode</th> <th>Country</th> </tr>
<tr>
@@ -16,6 +16,6 @@
<tr>
<td>5</td> <td>Berglunds snabbköp</td> <td>Christina Berglund</td> <td>Berguvsvägen 8</td> <td>Luleå</td> <td>S-958 22</td> <td>Sweden</td> </tr>
</table>
<h2>SQL SELECT TOP 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取头两条记录:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><div class="example_code notranslate"> SELECT TOP 2 * FROM Customers; </div></pre> </div> <h2>SQL SELECT TOP PERCENT 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取前面 50% 的记录:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><div class="example_code notranslate"> SELECT TOP 50 PERCENT * FROM Customers; </div></pre> </div> <div class="text-center padding-10 margin-t-5">
<h2>SQL SELECT TOP 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取头两条记录:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><code class="language-sql"><div class="example_code notranslate"> SELECT TOP 2 * FROM Customers; </div></code></pre> </div> <h2>SQL SELECT TOP PERCENT 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取前面 50% 的记录:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><code class="language-sql"><div class="example_code notranslate"> SELECT TOP 50 PERCENT * FROM Customers; </div></code></pre> </div> <div class="text-center padding-10 margin-t-5">
</div>
</div>