Wilder1626
asked on
Oracle - Count distinct value without duplication from 2 tables
Hi,
I would like to count the number of time an equipment type was used on loads from 2 different tables, without any duplication that could be in both.
Each table as a load id and an equipment type attach to it. We cannot have the same load ID with 2 different equipment type.
Ex:
In load table, i may have below loads as an example:
In FP_MASTER_HIST, i may have below loads as an example:
As you can see. LOAD2 is duplicated and should only count as One.
What we also see is that we have same load id's in both table: load2 and load4. This also should be count only Once.
So the final result i would like to have in this Query would look like this:
I'm also giving a sample of the tables including the final result.
How can i do that?
Thank you for your help.
LOAD_COUNT_no2.xlsx
I would like to count the number of time an equipment type was used on loads from 2 different tables, without any duplication that could be in both.
Each table as a load id and an equipment type attach to it. We cannot have the same load ID with 2 different equipment type.
Ex:
In load table, i may have below loads as an example:
In FP_MASTER_HIST, i may have below loads as an example:
As you can see. LOAD2 is duplicated and should only count as One.
What we also see is that we have same load id's in both table: load2 and load4. This also should be count only Once.
So the final result i would like to have in this Query would look like this:
I'm also giving a sample of the tables including the final result.
How can i do that?
Thank you for your help.
LOAD_COUNT_no2.xlsx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad to help :-)
ASKER