24 lines
498 B
Plaintext
24 lines
498 B
Plaintext
Using an ``++ORDER BY++`` clause in a ``++SELECT++`` helps ensure runtime reproducibility. Without one, _some_ databases _may_ return results in a consistent order, but it is likely to be one that appears random to users and is not optimal for processing the data.
|
|
|
|
|
|
== Noncompliant Code Example
|
|
|
|
[source,text]
|
|
----
|
|
SELECT model -- Noncompliant
|
|
FROM car
|
|
WHERE wheel_count = 4
|
|
----
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
[source,text]
|
|
----
|
|
SELECT model
|
|
FROM car
|
|
WHERE wheel_count = 4
|
|
ORDER BY year, make
|
|
----
|
|
|