× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I really wish that the ORDER BY was allowed in an SQL view.
I think that view adoption would skyrocket since folks using native I/O in
an HLL like RPG could then access the view (aka non-keyed LF) in a
guaranteed order, without resorting to OPNQRYF and like, and leveraging new
SQE query engine at the same time (of course they can use embedded SQL today
and specify an ORDER BY on the SELECT, but some just refuse to).

Ordered views would also help with some creative logic in complex SQL
statements that target that view (I think).

Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com


-----Original Message-----
Subject: Re: strsql not showing all records

lgoodbar@xxxxxxxxxxxxxx wrote:
SQL != DDS.

Always use an ORDER BY clause on select statements if you intend to
review the result in a particular order. SQL does not guarantee record
order otherwise. What you saw was due to how the query optimizer chose
to access records, based on the different join and where conditions.

This is an excellent point. I've been bitten by this on more than one
occasion, especially when the default order came very CLOSE to what I
was expecting, just slightly different <grin>. ORDER BY is your friend,
even if it is a bit tedious (personally, I wish there was an ORDER BY
PRIMARY-KEY syntax, but I digress).

Joe



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.