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


  • Subject: Re: Sql Question
  • From: Rob Berendt <rob@xxxxxxxxx>
  • Date: Wed, 15 Dec 1999 14:59:33 -0500

select acctno,fldz from file 2 where acctno in(select acctno from file1) 
and fldz<2000000

But I was assuming that you didn't mean "if no record in file2 has FldZ 
value > 20000000
"  since you did have a sample retrived row.  I assumed you meant that 
"if the record in file2 has FldZ value > 20000000
"  




Gade_R_Reddy@consecofinance.com on 12/15/99 02:41:18 PM
Please respond to RPG400-L@midrange.com@Internet
To:     RPG400-L@midrange.com@Internet
cc:      
Fax to: 
Subject:        Sql Question


Hey Guys,

I got a question in SQL which i want to run from my RPGLE program.

I have two files..

File1
Acctno    Fld1 Fld2 Fld3
123  a    a    a
456  b    b    b

File2
Acctno    FldX FldY FldZ
123  a1   b1   19991011
123  a1   b1   19991105
123  a1   b1   20020106
456  a2   b2   19991001
456  a2   b2   19991231


Now i want to write a Sql which does the following..

- Want to print all the Acctno & FldZ  where Acctno matches in both the
files and only if no record in file2 has FldZ value > 20000000

So if i run the sql statement with the above data i want the output to be

 AcctNo        FldZ
456       19991231 ( because the two records has FldZ value < 20000000 but
in acctno 123 we have one record whose FldZ value > 20000000 )


Any suggestions please.

Gade.



+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


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.