我有两张桌子。
表1
CRS Name Total_Exposure_Amount
Ackerman & Co LLC 152,823.00
Arbeit investments 489,756,203.00
Ashton woods 4,785,683.25
Alience Residential 235,694.58
表2
CRS_Name Outstanding_balance
Ackerman & Co LLC 123,566.23
Ackerman & Co LLC 0.21
Arbeit investments 2,331.26
Arbeit investments 32,566.00
Ashton woods 123,462
Ashton Woods 36,245.24
Alience Residential 32,134.26
我需要的决赛桌是这样的
决赛桌
CRS_Name Outstanding_Balance Relations_TBE
Ackerman & Co LLC 123,566.23 152,823.00
Ackerman & Co LLC 0.21 152,823.00
Arbeit Investments 2,331.26 489,756,203.00
Arbeit Investments 32,566.00 489,756,203.00
Ashton woods 123,462 4,785,683.25
Ashton Woods 36,245.24 4,785,683.25
Alience Residential 32,134.26 235,694.58
无论如何我们可以使用Proc sql来做到这一点吗?任何帮助将不胜感激。
答案 0 :(得分:0)
它是两个表之间的简单连接,基于两个表之间的公共密钥,在这种情况下是CRS_Name。
proc sql;
create table final_table as
select a.CRS_NAme,b.Outstanding_Balance, a.Outstanding_balance
from table_1 a, table_2 b
where a.CRS_Name= b.CRS_Name;
quit;