Hi,
I have two tables: one with all items from a ERP-system (2), and one with manual correction to the items lists product hierachy (1). The manual corrections (1) can hold items which also will be found in the item list table (2).
The two tables are joined in an UNION query. My problem is that in case the item is found in both tables I only want to keep records from table (1).
So this table:
<colgroup><col width="67" style="width:50pt"> <col width="157" style="width:118pt" span="4"> <col width="44" style="width:33pt"> <col width="74" style="width:56pt"> <col width="134" style="width:101pt"> </colgroup><tbody>
</tbody>
Should end up like this:
<colgroup><col width="67" style="width:50pt"> <col width="157" style="width:118pt" span="4"> <col width="44" style="width:33pt"> <col width="74" style="width:56pt"> <col width="134" style="width:101pt"> </colgroup><tbody>
</tbody>
I have tried MIN, FIRST etc, but then I get the wrong hierachy
Any help will be much appreciated - thanks
brgds
a novice
I have two tables: one with all items from a ERP-system (2), and one with manual correction to the items lists product hierachy (1). The manual corrections (1) can hold items which also will be found in the item list table (2).
The two tables are joined in an UNION query. My problem is that in case the item is found in both tables I only want to keep records from table (1).
So this table:
MinOfSYS | FirstOfHierarchy 1 | FirstOfHierarchy 2 | FirstOfHierarchy 3 | FirstOfCOMPANY | UNITS | COST | EAN |
1 | ABC | DDD | KKK | AAA | 6 | 46,04553 | 6.310.183.055.272 |
1 | ABC | DDD | KKK | AAA | 6 | 49,163 | 6.310.183.055.289 |
1 | ABC | DDD | KKK | AAA | 6 | 50,7706 | 6.310.183.055.296 |
1 | ABC | DDD | KKK | AAA | 6 | 53,9078 | 6.310.183.055.302 |
2 | ABC | DDD | KKK | BBB | 6 | 46,04553 | 6.310.183.055.272 |
2 | ABC | DDD | KKK | BBB | 6 | 49,16308 | 6.310.183.055.289 |
2 | ABC | DDD | KKK | BBB | 6 | 50,77057 | 6.310.183.055.296 |
2 | ABC | DDD | KKK | BBB | 6 | 53,90778 | 6.310.183.055.302 |
2 | ABC | DDD | KKK | BBB | 96 | 1002,82563 | 6.310.183.256.013 |
2 | ABC | DDD | KKK | BBB | 96 | 968,89833 | 6.310.183.256.006 |
<colgroup><col width="67" style="width:50pt"> <col width="157" style="width:118pt" span="4"> <col width="44" style="width:33pt"> <col width="74" style="width:56pt"> <col width="134" style="width:101pt"> </colgroup><tbody>
</tbody>
Should end up like this:
MinOfSYS | FirstOfHierarchy 1 | FirstOfHierarchy 2 | FirstOfHierarchy 3 | FirstOfCOMPANY | UNITS | COST | EAN |
1 | ABC | DDD | KKK | AAA | 6 | 46,04553 | 6.310.183.055.272 |
1 | ABC | DDD | KKK | AAA | 6 | 49,163 | 6.310.183.055.289 |
1 | ABC | DDD | KKK | AAA | 6 | 50,7706 | 6.310.183.055.296 |
1 | ABC | DDD | KKK | AAA | 6 | 53,9078 | 6.310.183.055.302 |
2 | ABC | DDD | KKK | BBB | 96 | 1002,82563 | 6.310.183.256.013 |
2 | ABC | DDD | KKK | BBB | 96 | 968,89833 | 6.310.183.256.006 |
<colgroup><col width="67" style="width:50pt"> <col width="157" style="width:118pt" span="4"> <col width="44" style="width:33pt"> <col width="74" style="width:56pt"> <col width="134" style="width:101pt"> </colgroup><tbody>
</tbody>
I have tried MIN, FIRST etc, but then I get the wrong hierachy
Any help will be much appreciated - thanks
brgds
a novice