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



Here is a suggestion:

Select Pro from StopOffTable t1
Where exists (select 1 from StopOffTable t2 where t1.Pro = t2.Pro and
t1.BillPnt <> t2.BillPnt)
Group by Pro


Chris Hiebert
Senior Programmer/Analyst
Disclaimer: Any views or opinions presented are solely those of the
author and do not necessarily represent those of the company.
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of
RPGLIST
Sent: Thursday, September 11, 2014 11:09 AM
To: rpg400-l@xxxxxxxxxxxx
Subject: Sql Comparison Statement help needed

I have a file with over 18,000 stop off points, They are grouped
according to the pro number and stop off number:

Pro: 198756
Stop: 1

Pro: 198756
Stop: 2

etc.

Within each set I have a field that is used for billing purposes:
BillPnt

Now, all the lines should have the exact same bill point value, it is a
3 alpha field, it can be blank as well.

I need to select all the records where the value is different from one
stop off point to another grouped by the pro number.

IE:

BAD
Pro: 198756
Stop: 1
BillPnt: 707

Pro: 198756
Stop: 2
BillPnt: *Blank

GOOD
Pro: 205478
Stop: 1
BillPnt: 200

Pro: 205478
Stop: 2
BillPnt: 200


I need to capture in a new file just the Pro number for those that have
a mismatch IE: BAD.

I can group the records, but I'm not sure how to structure the sql
statement for the comparison....

Suggestions would be greatly appreciated.

Dutch


--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To
subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
http://archive.midrange.com/rpg400-l.


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.