select Pro, count(distinct BillPnt) from stopoffs group by Pro having count(distinct BillPnt) > 1
Scott
-----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....
This mailing list archive is Copyright 1997-2026 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.