× 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 Wed, May 26, 2010 at 7:48 PM, cfuture <cfuture@xxxxxxxxxxx> wrote:
---With fifteen possible non-zero values in WorkFile, and possibly
having a match on all fifteen, you will have to have fifteen joins and
there is no way getting around that.

Actually, there is...don't use joins at all.

Since each record will only fill one column, you can use aggregate
functions as I posted before...

create view trav_pivot as
(select trav#,
max(case seq# when 1 then proc else 0) as proc1,
max(case seq# when 2 then proc else 0) as proc2,
max(case seq# when 3 then proc else 0) as proc3,
<...>
group by trav#

I assume this will work faster as you only read the file once instead
of 15 times as with the joins...but I've never benchmarked it.

HTH,
Charles

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.