Re: Compare 2 tables

From: Shakespeare <whatsin_at_xs4all.nl>
Date: Mon, 09 Mar 2009 12:00:35 +0100
Message-ID: <49b4f6d6$0$182$e4fe514c_at_news.xs4all.nl>



coral.ressources_at_gmail.com schreef:
> I have 2 tables: Input and Output.
> Input table stores records in this manner:
> recno, prod_first, prod_span, prod_last
> 1, 1, 1000, 1000
> 2, 1001, 700, 1700
> 3, 1701, 100, 1800
> ...and so on
> prod_first is the id of the product,
> prod_span is the number of products stored by recno,
> prod_last is the last product stored by recno
>
> Output tables stores records related to outgoings:
> recno, prod_first, prod_span, prod_last
> 1, 500, 25, 525
> 2, 300, 100, 400
> 3, 1243, 100, 1343
> That mean productss no from 500 to 525, 300 to 400 and 1243 to 1343
> were delivered, while the rest from input table are still in stock.
> Question: how to find what is [still] in input table and not [yet] in
> output table?
> prod_first to prod_last are the items to be found in both tables.
> I tought like this:
> 1. make 2 temp tables: input_temp, output_temp where i would insert
> all records [one-by-one] since in original tables i have only start &
> end.
> 2. make a comparison between the 2 temp tables (using SQL aggregation)
> I am concerned that step 1 would hit the db performance as i have for
> input table aprox 100 000 [and growing!] records to insert.
>

In your system, is it possible to have as outgoing:

1, 1650,100,1750 ? So: overlap on boundaries of ingoing?

Shakespeare Received on Mon Mar 09 2009 - 06:00:35 CDT

Original text of this message