It looks like there's no way to put an ORDER BY clause in a CREATE VIEW
statement.  I'm trying

create view mikee/osp1 as select * from mikee/osp001 inner join
mikee/osp002 on ohtid = odtid and ohseq = odseq order by oheda8

and getting

Keyword ORDER not expected. Valid tokens: <END-OF-STATEMENT>.

Am I correct in that assumption?  And if so, does anyone have a nifty way
to get around this?  I was hoping to create a view that joins two files and
orders them the way I need them.

If I can't do this, which of the following would provide better
performance:

1.  Use SQLRPGLE and have the SELECT join and order the files as I need
them.
2.  Create a view that joins the files, then use SQLRPGLE and have the
SELECT order the view as I need it.

Mike E.




Dan:

The join using the WHERE is no different than the join using the JOIN. (A
rose by any other name....)  Within my embedded SQL, I like to use the JOIN
operator because it's consistent with the LEFT OUTER JOIN and EXCEPTION
JOIN operators.   I must say the more SQL I learn, the more I love it!

David Smith
dsmith@xxxxxxxxx


----original message------
dan said:
<snip>
So, I am surprised to see that the generated SQL doesn't have any Join
clauses (?) but, instead,
does the join via WHERE, i.e.:
<more snip>







As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.