Desktop productivity for business analysts and programmers

Merging data with full outer join

Reply
Occasional Contributor
Posts: 9

Merging data with full outer join

I have two set of data which are policy (table 1) and claim (table 2) data. Multiple claims have been subtotal by policy no. I have merged these data by policy no. level yet there are blank cell in between when I pull only policy no. from table 1 and vice versa. How do I merge policy no. from table 1 and table 2 into one column other than doing formulae by adding new column?

Frequent Contributor
Posts: 89

Re: Merging data with full outer join

Super User
Posts: 7,431

Re: Merging data with full outer join

Use

select coalesce(a.policy_no,b.policy_no) as policy_no

from policy a full join claim b on a.policy_no = b.policy_no;

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 9

Re: Merging data with full outer join

It works. thanks Kurt!

Ask a Question
Discussion stats
  • 3 replies
  • 347 views
  • 1 like
  • 3 in conversation