× 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.



Thanks for the confirmation.

So far my tests corroborate.

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
------------------------------

message: 3
date: Fri, 12 Mar 2021 07:40:34 -0700
from: Charles Wilt <charles.wilt@xxxxxxxxx>
subject: Re: Speaking of SQL.....

No need for CTE's

UNION ALL is all the Richard needs

Select * from table1 join table 2 on date and type=?FI?
UNION ALL
Select * from table1 join table 2 on type=?I?

If you want duplicates between the two sets removed, then just use UNION Select * from table1 join table 2 on date and type=?FI?
UNION
Select * from table1 join table 2 on type=?I?

UNION is a SQL set operator. The others available are INTERSECT and EXCEPT https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_72/db2/rbafzmark.htm

Charles

On Fri, Mar 12, 2021 at 5:58 AM Alan Shore via MIDRANGE-L < midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

Try this
With tablefi as
(Select * from table1 join table 2 on date and type=?FI?), tableI as
(Select * from table1 join table 2 on type=?I?) Select a.* from
tablefi a Union all Select b.* from tablei

Or something like that





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.