Skip to main content
userLP's user avatar
userLP's user avatar
userLP's user avatar
userLP
  • Member for 7 years, 9 months
  • Last seen more than 2 years ago
awarded
awarded
awarded
awarded
revised
Loading…
awarded
Loading…
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
Actually, I've found that this eliminates some Deal_IDs that aren't null, as per @ypercubeᵀᴹ questioning above where he says "Say we have 2 rows, with (deal_id, exchange_id, pub_id): (3389, 4, 1780) and (3390, 4, 1780) (which I think should be coming from the First table) and another (1) row with (NULL, 4, 1780) which should be coming from the Second table. Now the problem is: when we add up the group with (exchange_id, pub_id) = (4, 1780), the summations are not a problem. But which deal_id to show in the result? 3389 or 3390? (because we can only show one)"
awarded
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
Not quite, because We are now missing the Sum of Second_imps, and incremental isn't simply the distinct users from the First table, it's the distinct users from the first table that don't exist in the second
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
actually heres a more accurate one, with an overlapping user_id so that you can see the incremental function
comment
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
I would like the sums of (exchange_id, pub_id) to be added to both deal_ids 3389 and 3390
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
I sort of see what you're saying, it doesn't aggregate because the conditions aren't clear enough. In my head I was hoping for what usually happens in a [left] or [right] join where matches can happen on more than one item Is there a manipulation that we can do so that it's shown on more than one deal_id or is something inherently wrong with the query?
awarded
revised
Loading…
awarded
revised
Loading…
comment
How can I group the null results in this FULL OUTER JOIN with non-null responses?
@ypercubeᵀᴹ yes on both accounts, (exchange_id, pub_id, user_id) is unique in each table and the deal_id is in the GROUP BY, have corrected the query above.