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 ORDER BY 关键字</h1>
<p class="intro">ORDER BY 关键字用于对结果集进行排序。</p> <h2>SQL ORDER BY 关键字</h2> <p>ORDER BY 关键字用于对结果集按照一个列或者多个列进行排序。</p> <p>ORDER BY 关键字默认按照升序对记录进行排序。如果需要按照降序对记录进行排序,您可以使用 DESC 关键字。</p> <h3>SQL ORDER BY 语法</h3> <div class="code notranslate"><pre><div> SELECT <em>column_name</em>,<em>column_name</em><br/> FROM <em>table_name</em><br/> ORDER BY <em>column_name</em>,<em>column_name</em> ASC|DESC;</div></pre></div> <h2>演示数据库</h2> <p>在本教程中,我们将使用众所周知的 Northwind 样本数据库。</p> <p>下面是选自 "Customers" 表的数据:</p> <table class="reference notranslate">
<p class="intro">ORDER BY 关键字用于对结果集进行排序。</p> <h2>SQL ORDER BY 关键字</h2> <p>ORDER BY 关键字用于对结果集按照一个列或者多个列进行排序。</p> <p>ORDER BY 关键字默认按照升序对记录进行排序。如果需要按照降序对记录进行排序,您可以使用 DESC 关键字。</p> <h3>SQL ORDER BY 语法</h3> <div class="code notranslate"><pre><code class="language-sql"><div> SELECT <em>column_name</em>,<em>column_name</em><br/> FROM <em>table_name</em><br/> ORDER BY <em>column_name</em>,<em>column_name</em> ASC|DESC;</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>ORDER BY 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 列排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country; </div></pre> </div> <h2>ORDER BY DESC 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 列降序排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country DESC;</div></pre> </div> <h2>ORDER BY Several Columns 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 和 "CustomerName" 列排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country,CustomerName;</div></pre> </div> <div class="text-center padding-10 margin-t-5">
<h2>ORDER BY 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 列排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><code class="language-sql"><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country; </div></code></pre> </div> <h2>ORDER BY DESC 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 列降序排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><code class="language-sql"><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country DESC;</div></code></pre> </div> <h2>ORDER BY Several Columns 实例</h2> <p>下面的 SQL 语句从 "Customers" 表中选取所有客户,并按照 "Country" 和 "CustomerName" 列排序:</p> <div class="example margin-b-10"> <h2 class="example">实例</h2> <pre><code class="language-sql"><div class="example_code notranslate"> SELECT * FROM Customers<br/> ORDER BY Country,CustomerName;</div></code></pre> </div> <div class="text-center padding-10 margin-t-5">
</div>
</div>