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



On 9/27/07, donna lester <donna_lester_ny@xxxxxxxxx> wrote:
I have a query between two files FILE1, FILE2

type of join : 1 Matched records.
how to join : T01.SBKRNM EQ T02.SRCDTA
SELECT RECORDS: T01.SQCDE LIST 'SA' 'SB' 'SD' 'SG' 'SH'

the count of records is 465,962

I have written equivalent SQL(I dont think its correct bcoz count is differing) as I need SQL conversion of above query.

SELECT COUNT(*) FROM FILE1 A JOIN
FILE2 B ON A.SBKRNM = B.SRCDTA
AND A.SQCDE IN('SA', 'SB', 'SD', 'SG', 'SH')


this seems correct, although I dont know enough query400 to say
otherwise. I would not use "right outer join" because a) I dont know
what it means and b) you only ever need join which gives you matching
rows and left outer join which gives you all the rows in a whether
they match or not with b.

If the count is high with your join query check that there is more
than 1 b row for every matching a row.
with t1 as (
select a.sbkrnm, b.srcdta, count(*) joinCount
from file1 a
join file2 b
on a.sbkrnm = b.srcdta
group by a.sbkrnm, b.srcdta
)
select * from t1 where joinCount > 1

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.