On 27/04/2022 17:37, Bryan Pendleton wrote:
> There is no natural order for rows in SQL. If you care about the order
> of the rows in your result, you must always specify an ORDER BY
> clause.
Well, the "default" ordering (no ORDER BY clause) reflects the order of
insertion. It seems odd to me
There is no natural order for rows in SQL. If you care about the order
of the rows in your result, you must always specify an ORDER BY
clause.
Instead of putting the ORDER BY in the definition of the view, put the
ORDER BY on the SELECT statement from the view.
That is, don't do:
Sorting behavior is only defined for the columns in the ORDER BY clause.
If a column is not included in the ORDER BY clause, then its sort order
can be arbitrary and not even consistent across executions of the query.
Hope this helps,
-Rick
On 4/27/22 4:35 AM, John English wrote:
I have a