Morning all
I am giving myself a headache in trying to solve a problem with SQL I've tried looking through the archives, but I am not really too sure what I am looking for.
Anyway, if anyone can help me,
The problem is as follows:-
I have 2 files, in their simplistic form FileA Order number Item number Quantity Category Sub category
FileB
Item number
Category
Sub category
In FileB, Item number is NOT unique. Item number within Category IS unique.
For example Item number 000001 can be in Category 0001 AND in Category 0094 What I want to happen is that for an order that contains item number 000001, I want a file (FileC) that contains 2 records from the original 1.
One record with Category 0001 and the other record with category 0094.
FileA to FileC is a one to many ratio.
The other problem is if the item number does NOT exist on FileB, FileC should contain one record with 0 category.
I think that's it.
If anyone can help, or point me in the right direction, I would be VERY grateful
I am giving myself a headache in trying to solve a problem with SQL I've tried looking through the archives, but I am not really too sure what I am looking for.
Anyway, if anyone can help me,
The problem is as follows:-
I have 2 files, in their simplistic form FileA Order number Item number Quantity Category Sub category
FileB
Item number
Category
Sub category
In FileB, Item number is NOT unique. Item number within Category IS unique.
For example Item number 000001 can be in Category 0001 AND in Category 0094 What I want to happen is that for an order that contains item number 000001, I want a file (FileC) that contains 2 records from the original 1.
One record with Category 0001 and the other record with category 0094.
FileA to FileC is a one to many ratio.
The other problem is if the item number does NOT exist on FileB, FileC should contain one record with 0 category.
I think that's it.
If anyone can help, or point me in the right direction, I would be VERY grateful