> For the complete documentation index, see [llms.txt](https://doc.duaer.com/zh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.duaer.com/zh/snippets/merge-lists-by-key.md).

# 在 Duaer 里按关键字段合并两张表（类似 VLOOKUP）

在 Duaer 里用 Merge 节点按订单号、邮箱这样的字段把两路数据对上，可以只留匹配的、补全左表，或找出对不上的。
## 在 Duaer 里按字段合并

1. 把两路数据接到 [Merge](/zh/build/merge.md) 的 Input 1 和 Input 2，例如订单表和付款记录。
2. Mode 选 Combine，Combine By 选 Matching Fields。
3. 两边字段同名时，Fields to Match 填 order_id；不同名时打开 Fields To Match Have Different Names，分别填 Input 1 Field 和 Input 2 Field。
4. 按需要选 Output Type（见下表），点执行此步骤。

## Duaer Merge 的 Output Type 怎么选

- Keep Matches：只留两边都有的，像内连接。
- Enrich Input 1：保留 Input 1 全部，能对上的补上 Input 2 的字段，像 VLOOKUP 或左连接。
- Keep Non-Matches：只留对不上的，适合对账找差异。
- Keep Everything：两边全留。

一边是数字 123、一边是文字 "123" 时对不上。在 Options 里打开 Fuzzy Compare，或先用 Edit Fields 把类型统一。两边有同名字段时，用 Options 里的 Clash Handling 决定留哪边。
## Questions

### Duaer Merge 明明有相同订单号却对不上？

多半是一边数字一边文字，或带了空格。在 Duaer Merge 的 Options 里打开 Fuzzy Compare，或先 trim 并统一类型。

### Duaer 里怎么做对账，找出两边对不上的记录？

在 Duaer Merge 里选 Combine By Matching Fields，Output Type 选 Keep Non-Matches。

## 相关

- [在 Duaer 里配置 Merge 节点](https://doc.duaer.com/zh/build/merge.md)
- [在 Duaer 里用 Merge 汇合数据](https://doc.duaer.com/zh/flow-logic/merging.md)
- [在 Duaer 里去重：本次重复和以前处理过的](https://doc.duaer.com/zh/snippets/remove-duplicates.md)

