Question
I have 2 tables with below schema and data:
regular_fee table
additional_fee table
I want to merge these 2 tables so that the final output would look like below:
Tried
I tried to merge them using FULL OUTER JOIN, but the result does not look right. Here’s my query
SELECT
rf.sellable_id,
rf.channel_id,
rf.company_id,
rf.customer_fee,
rf.subscription_fee,
af.sellable_id,
af.channel_id,
af.company_id,
af.base_rate,
af.store_fee,
af.item_vol
FROM
regular_fee rf
FULL OUTER JOIN
additional_fee af
ON rf.company_id = af.company_id
WHERE
AND rf.posted_date BETWEEN '2024-01-01' AND '2024-03-31'
AND af.charge_date BETWEEN '2024-01-01' AND '2024-03-31';
Result be like:
where it auto-populate the col value if not exist, but I don’t want to do that.