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



From: Jeff Day

Bill,
I would think something like this should work:

select I_CONTROL#, I_STATUS, I_TMSP, O_OWNER
from inventory join owner on i_control# = o_control#
where O_TMSP <= I_TMSP

Unfortunately, this will result in multiple rows for each inventory record
because multiple owner records will be selected on the join (every owner
record with a timestamp less than or equal to the inventory timestamp). You
have to force the join to one and only one owner record, specifically the
one with the _highest_ timestamp less than or equal to the one on inventory.

It's not easy, but it can be done:

select I_CONTROL#, I_STATUS, I_TMSP, O_OWNER
from inventory join owner on I_CONTROL# = O_CONTROL#
where O_TMSP = (select MAX(O_TMSP) from owner
where O_CONTROL# = ICONTROL# and O_TMSP <= I_TMSP)

It may require some qualification of the files to eliminate ambiguities, but
the general idea is there.

Joe



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.