I've got the following table in a Postgres database:
Table Example:
---------------------------
name | number
---------------------------
DefaultName | 1
DefaultName | 2
DefaultName | 3
DefaultName | 4
Charlie | 1
Charlie | 3
Charlie | 4
Charlie | 5
Amanda | 2
Amanda | 3
Amanda | 4
Amanda | 5
I need to get the "number"s that are present in the 'DefaultName', but that are not present in each "name"s that differ from 'DefaultName'. In this case, it would return:
---------------------------
names | numbers
---------------------------
Charlie | 2
Amanda | 1
I am trying a Left Join like the one below, but I can't figure a way to get the DefaultName numbers crossed with a negation with the other names'...
SELECT Test_Configs.name, Default_Configs.number
FROM Example AS Test_Configs
LEFT JOIN Example AS Default_Configs
ON Default_Configs.name = 'DefaultName'