Re: SQL query - help needed
Date: Wed, 25 Apr 2001 12:40:03 GMT
Message-ID: <3AE6C4CF.FBA4878E_at_cgi.ca>
Lynn,
It sounds like the base tables have a Primary/Foreign key relationship..what if
you construct a view to suit what you need? It sounds like all you need is an
equijoin based on your statement that you want the same number of fields in each
row..an equijoin will produce a result for each of the multiple values in the
foreign key that correspond to each unique key value...so your WHERE clause
would simply be:
WHERE fk_of_small_table = unique_key_of_100000_record_table;
Please let me know if I misinterpreted your question.
Steve
"Lynn C. Ormond" wrote:
> I have 2 Oracle 7 views I need to combine with a select statement.
>
> The first has 100,000 + records with a unique key. The second has multiple
> records ( or none ) on the same key.
>
> I need left join(?) syntax which will allow me to get all of the multiple
> records in the second file attached to each of the unique records in the
> first file, always having the same total number of fields in each row of the
> result set.
>
> Any ideas?
>
> --
>
> Lynn C. Ormond
> Lucero Research
> Reply to: Lynn_at_Lucero.com
Received on Wed Apr 25 2001 - 14:40:03 CEST