我有df1
+-----+------------------------+---------------------------+----------------------+---------+
|JobId|TotalRecordType1Count |TotalRecordType2Count |TotalRecordType3Count |JobStatus|
+-----+------------------------+---------------------------+----------------------+---------+
| 100| 0| 0| 0|Success |
+-----+------------------------+---------------------------+----------------------+---------+
df2组件
+---------------------------+----------------------+
|TotalRecordType1Count |TotalRecordType2Count |
+---------------------------+----------------------+
| 800| 900|
+---------------------------+----------------------+
df1和df2都只有一行。
我想在公共计数列上组合df1和df2,并保留df2的计数
+-----+------------------------+---------------------------+----------------------+---------+
|JobId|TotalRecordType1Count |TotalRecordType2Count |TotalRecordType3Count |JobStatus|
+-----+------------------------+---------------------------+----------------------+---------+
| 100| 800| 900| 0|Success |
+-----+------------------------+---------------------------+----------------------+---------+
1条答案
按热度按时间jfgube3f1#
您可以进行交叉连接,并根据需要选择列: