forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Lu, Huayi <luhuayi@huawei.com> Co-committed-by: Lu, Huayi <luhuayi@huawei.com>
18 lines
1.8 KiB
HTML
18 lines
1.8 KiB
HTML
<a name="EN-US_TOPIC_0000001772536564"></a><a name="EN-US_TOPIC_0000001772536564"></a>
|
|
|
|
<h1 class="topictitle1">ORDER BY</h1>
|
|
<div id="body8662426"><p id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_p19579230122414">In MySQL, if an <strong id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_b50694302432448">UPDATE</strong> statement includes an <strong id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_b132972958532448">ORDER BY</strong> clause, the rows will be updated in the order specified by the clause.</p>
|
|
<p id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_p8060118"><strong id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_b897790202013">Input</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_screen1251619362013"># ORDER BY
|
|
UPDATE employees SET department_id=department_id+1 ORDER BY id;</pre>
|
|
<p id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_p8785143932018"><strong id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_b18996550152018">Output</strong></p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001772536564__en-us_topic_0000001657865622_en-us_topic_0000001438011253_en-us_topic_0214164431_screen528325392010">-- ORDER BY
|
|
UPDATE "public"."employees" SET "department_id" = department_id+1;</pre>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="dws_16_0193.html">UPDATE</a></div>
|
|
</div>
|
|
</div>
|
|
|