Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

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:
User generated image
In FP_MASTER_HIST, i may have below loads as an example:
User generated image
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:
User generated image
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
Avatar of awking00
awking00
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Wilder1626

ASKER

Thank you. This is exactly what i needed.
Glad to help :-)