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



I misread the original message.
Couldn't you take Rob's original example and only select those records that have a count of 1?

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Grizzly Malchow
Sent: Tuesday, March 31, 2009 1:25 PM
To: Midrange Systems Technical Discussion
Subject: RE: SQL question

Try adding
ORDER BY key
at the end of the sql statement.


-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of Lance Gillespie
Sent: Tuesday, March 31, 2009 12:59 PM
To: Midrange Systems Technical Discussion
Subject: Re: SQL question

Thank you, Rob. When I run your suggestion, I get:

ACCOUNT ADDRESS COUNT ( ACCOUNT
11 11 MAIN 2
13 12 MAIN 1
12 12 MAIN 1
14 13 MAIN 1
16 15 MAIN 2
15 15 MAIN 1
17 16 MAIN 1
18 17 MAIN 1

and it is not clear to me how I would know from this result
that the 1st, 4th, 7th, and 8th pairs were good and
the rest were bad.

(Record 6 in my sample table is wrong - should be 15 Main)

I think maybe this is not an SQL question. Maybe RPG does
have a reason to exist!

Thanks again,
Lance



<rob@xxxxxxxxx> 3/31/2009 10:18 AM >>>
select account, address, count(account)
from mytable
group by account,address

Rob Berendt

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.